I am working on a batch file that would need to check if an icon exists on the desktop, if not i want it to check the program folder and if there move it to the desktop. If it isnt installed i want it to run the install file. Can this be done with a batch file if so how?
2 に答える
0
「プログラムフォルダ」にアイコンが存在しない場合は他の条件が存在しないため、2番目の条件は省略できます。アイコンが存在しない場合は何も起こらず、恐れることなく直接移動しようとすることができます.
コードは次のとおりです。
@Echo OFF
Set "IconFileName=Icon.ico"
Set "ProgramFolder=%CD%"
if not exist "%USERPROFILE%\Desktop\%IconFileName%" (
Move /Y "%ProgramFolder%\%IconFileName%" "%USERPROFILE%\Desktop\%IconFileName%" 2>NUL
) ELSE (
Start /W "" "%ProgramFolder%\Setup.exe" & REM -Parameters
)
Pause&Exit
于 2013-05-18T23:24:35.750 に答える
0
これは航空コードです:
@echo off
if not exist "z:\folder\desktop\iconname.ico" (
if exist "z:\program folder\iconname.ico" (
move "z:\program folder\iconname.ico" "z:\folder\desktop\" >nul
) else (
start "" "c:\backup\program installer.exe"
)
)
于 2013-05-18T04:50:21.307 に答える