Vbscript error when running command with long argument

I need to execute a script on vbs

I have no problems with program.exe with this script

objShell.Run("%SystemDrive%\temp\program.exe")

However, the program may support the argument for silent installation.

I run the following command manually on cmd

% SystemDrive% \ temp \ program.exe / s /v"MS=1.1.1.1 SF =% SystemDrive% \ temp \ cert.ssl โ€‹โ€‹-l * v +!% Temp% \ install.log IP = False CFG = "CFG_GRP" ICG = "ICG_GRP" REBOOT = Force / qn ""

so I put this command in a script, but I get an exception error ')'

objShell.Run("%SystemDrive%\temp\program.exe /s /v"MS=1.1.1.1 SF= %SystemDrive%\temp\cert.ssl -l*v+! %temp%\install.log IP=False CFG="CFG_GRP" ICG="ICG_GRP" REBOOT=Force /qn""")

any idea?

+1
source share
1 answer

try it

Command = "cmd /c %SystemDrive%\temp\program.exe /s /v""MS=1.1.1.1 SF= %SystemDrive%\temp\cert.ssl -l*v+! %temp%\install.log IP=False CFG=""CFG_GRP"" ICG=""ICG_GRP"" REBOOT=Force /qn"""""
objShell.Run Command

or

objShell.Run "cmd /c %SystemDrive%\temp\program.exe /s /v""MS=1.1.1.1 SF= %SystemDrive%\temp\cert.ssl -l*v+! %temp%\install.log IP=False CFG=""CFG_GRP"" ICG=""ICG_GRP"" REBOOT=Force /qn"""""

In any case, the problem will be wrong.

" , , "", VBScript .

0

All Articles