0

here is my original win xp batch file:

@echo off
%~d1
cd "%~p1"
set swf=%~f1

set media=%~p1..\media.lnk
echo set WshShell = WScript.CreateObject("WScript.Shell")>DecodeShortCut.vbs
echo set Lnk = WshShell.CreateShortcut(WScript.Arguments.Unnamed(0))>>DecodeShortCut.vbs
echo wscript.Echo Lnk.TargetPath>>DecodeShortCut.vbs
set vbscript=cscript //nologo DecodeShortCut.vbs
For /f "delims=" %%T in ( ' %vbscript% "%media%" ' ) do set Mtarget=%%T
del DecodeShortCut.vbs

set pictlib=%~p1..\pictlib.lnk
echo set WshShell =  WScript.CreateObject("WScript.Shell")>DecodeShortCut.vbs
echo set Lnk =  WshShell.CreateShortcut(WScript.Arguments.Unnamed(0))>>DecodeShortCut.vbs
echo wscript.Echo Lnk.TargetPath>>DecodeShortCut.vbs
set vbscript=cscript //nologo DecodeShortCut.vbs
For /f "delims=" %%T in ( ' %vbscript% "%pictlib%" ' ) do  set Ptarget=%%T
del DecodeShortCut.vbs

echo media %media% 
echo Media_Target   %Mtarget%
echo.
echo pictlib %pictlib%
echo pictlib_target %Ptarget%

copy /Y "%swf%" "%Mtarget%"
copy /Y "%swf%" "%Ptarget%

pause >nul

this batch file simply reads up one level in the directory to find the target of a shorcut named "Media" and another shortcut named "pictlib" and copies the file there.

in win 7 I receive an error "The system cannot find the path specified."

any sugestions on how to resolve my path issues?

Joe
  • 1

1 Answers1

0

EDIT: after further testing and headache i discovered that win 7 has issue with the spaces in the path name from network drives

happymacarts
  • 2,547
  • 1
  • 25
  • 33