used environment variables for system paths, like %ProgramFiles(x86)% and %PUBLIC%, because the directory locations may be different on some systems.reversed the if query as you want something to happen in case the condition is not met this also avoids the need of goto in addition, never define a label :EOF as this is a reserved name (see this: goto) regard that your if/ else syntax is wrong!.added pushd to resolve the UNC path \\hazel\software$ as some commands might have trouble with such || means to execute next command in case of failure, exit /B 1 exits the batch file if pushd fails, like when the path could not be found popd at the end restores the previous working directory finally. ".\YawCam\v6.0\yawcam_install.exe" /SP- /VERYSILENTĬopy /Y ".\YawCam\Doc Cam.lnk" "%PUBLIC%\Desktop\Doc Cam.lnk" If not exist "%ProgramFiles(x86)%\Yawcam\Yawcam.exe" ( I would write it like this: pushd "\\hazel\software$" || exit /B 1
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |