开发者

porting an xp batch file to win7

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 receiv开发者_运维知识库e an error "The system cannot find the path specified."

any sugestions on how to resolve my path issues?


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜