Scripting Error -1 when running a batch file
I have a batch file setup to push Symantec Endpoint to both x86 and x64 systems. I found most of the info here: http://www.itninja.com/blog/view/how-to-deploy-the-symantec-endpoint-protection-client-12-1-from-the-kace-1000
I uploaded 2 files for the shell script and then created the batch file from kbox. Here is the code I found.
@echo off IF EXIST "%PROGRAMFILES(X86)%" (GOTO 64BIT) ELSE (GOTO 32BIT) :64BIT setup64.exe :32BIT setup32.exe
It does find and install the correct software but displays failed in kbox.
Any ideas on how to correct this?
Answers (3)
I think the way you have your batch file right now, it's running both setups on 64-bit machines. Add a "GOTO :End" line in :64BIT, and of course ":End" at the very end of your batch file. Otherwise when it's done running setup64.exe, there is nothing keeping it from continuing on in the batch file to run setup32.exe.
So it would look like this:
:64BIT setup64.exe GOTO :END :32BIT
setup32.exe
:END
Comments:
-
Rrr it won't format my response properly...hope you get the idea - nheyne 11 years ago
This works great but there is a problem now. I want it to be silent but there is a command prompt window that comes up. I found this online to make the window invisible:
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "batchfilename.bat" & Chr(34), 0
Set WshShell = Nothing
and have upoaded the batchfile and set the script to a vbs but it fails after the script is executed.
Comments:
-
Just curious why you don't make this a managed install? Zip both installers along with your .bat file. - dugullett 11 years ago
-
For some reason I couldn't get it to run the batch file that way . I'm not great at scripting. - bender6681 11 years ago
-
Upload you zip file to your software record. When creating the MI select "Configure Manually", and in the box below that enter the name of your .cmd file. I also check mark "Delete Downloaded Files". - dugullett 11 years ago
-
I'll give it a shot. I think I didn't have it as cmd but as bat. - bender6681 11 years ago