Install an exe via bat file if directory doesn't exist
-
25-05-2021 - |
Pregunta
I'm calling a bat file from a windows startup script in a GPO and think I may have an error in my syntax, any ideas? The intention is to install the GoToManage unattended access program, but only if it isn't already installed.
@echo off
if EXIST "C:\Program Files (x86)\Citrix\GoToAssist Express Customer" (
exit
) ELSE (
if EXIST "C:\Program Files\Citrix\GoToAssist Express Customer" (
exit
) ELSE (
start \\serv1\SoftwareDeploy\RemoteSupport\RemoteSupport.exe
)
Any help would be greatly appreciated.
Cheers.
Solución
Try this:
@echo off
if EXIST "C:\Program Files (x86)\Citrix\GoToAssist Express Customer" GOTO End
if EXIST "C:\Program Files\Citrix\GoToAssist Express Customer" GOTO End
start \\serv1\SoftwareDeploy\RemoteSupport\RemoteSupport.exe
:End
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow