Batch file snapin install
-
server: 16.04.1 ubuntu.
client: 11.7
fog version: RC-36
os attempting to deploy to: windows 10Batch script snapin install?
I have this file of games that installs perfectly from within windows when executed. but when i try to do the same as a snapin, it downloads ,extracts ,states that it is installing and then as soon as it says installing, it says installed, but no program is installed.
The fog log say error code 1
I just dont now what im doing wrong?
its clear to me its something simple i just cant seem to put my finger on it
Could i get some help on the matter please.
screen shot of snapin window
here is the batch/cmd file contents:
@echo off Echo Wscript.Sleep 5000>"%Temp%\Wait.vbs" Echo WScript.Quit>>"%Temp%\Wait.vbs" Echo Installing Game Pack... Echo. For /f "tokens=*" %%a in ('dir /b /on "*[PopCap][ExtremlymTorrents.Me].exe"') do ( Echo Installing %%~na... Echo. Start "" /wait Wscript "%Temp%\Wait.vbs" Start "" /wait "%%a" /S ) Del "%Temp%\Wait.vbs"```
-
@Joe-Schmitt @Wayne-Workman @Tom-Elliott I thank you guys for the help but the original script worked just fine.
I believe this one was an user error and in this case me being that user.
When I made the snapin pack I messed up in how I told fog to execute the bat file inside by not telling fog that it had another folder to prior to trying to execute the bat file. as you can see from my original post I had simply
_install.bat"
when in reality it waspopcap/_install.bat
I have since then repacked the .zip file with no other folder in the way and simplified the bat file by naming it simplypop.bat
all with the original coding@echo off Echo Wscript.Sleep 5000>"%Temp%\Wait.vbs" Echo WScript.Quit>>"%Temp%\Wait.vbs" Echo Installing Game Pack... Echo. For /f "tokens=*" %%a in ('dir /b /on "*[PopCap][ExtremlymTorrents.Me].exe"') do ( Echo Installing %%~na... Echo. Start "" /wait Wscript "%Temp%\Wait.vbs" Start "" /wait "%%a" /S ) Del "%Temp%\Wait.vbs"
after doing this all the games installed silently with no issues via fog deployment services. Thank You!!! -
Looking at the script I can’t really tell you anything of what is, or isn’t, wrong.
That said, do you know IF the script is actually running?
Based on what I can see, we don’t know that at this point.
Maybe, to your batch script, you might add some redirects to write to logs on the system? This way you can see if the script is running and where it might be failing?
I’m not questioning your batch scripting capabilities, but I don’t know what information you do, or don’t know (so please don’t think I’m trying to belittle you or anything).
I might do something like:
@echo off echo "Starting script" >c:\PopCapInstall.log echo "Adding Wscript.Sleep 5000 to Wait.vbs file" >>c:\PopCapInstall.log Echo Wscript.Sleep 5000>"%Temp%\Wait.vbs" echo "Adding Wscript.Quit to Wait.vbs file" >>c:\PopCapInstall.log Echo WScript.Quit>>"%Temp%\Wait.vbs" echo "Installing Game Pack..." >>c:\PopCapInstall.log Echo Installing Game Pack... echo "" >>c:\PopCapInstall.log Echo. echo "Beginning loop" >>C:\PopCapInstall.log For /f "tokens=*" %%a in ('dir /b /on "*[PopCap][ExtremlymTorrents.Me].exe"') do ( echo "Installing %%~na..." >>c:\PopCapInstall.log Echo Installing %%~na... echo "" >>c:\PopCapInstall.log Echo. Echo "Starting Wscript run">>c:\PopCapInstall.log Start "" /wait Wscript "%Temp%\Wait.vbs" Echo "Starting %%a">>c:\PopCapInstall.log Start "" /wait "%%a" /S ) echo "Deleting Wait.vbs">>c:\PopCapInstall.log Del "%Temp%\Wait.vbs"
-
@dureal99d On a side note, your batch script is just creating a visual basic script and executing it. Why not just deploy a VBS in the snapin pack and skip the whole batch script work-a-round? The point of snapin packs is to let you bundle multiple files / scripts together.
-
@Tom-Elliott I know nothing of batch scripting but i’m slowly learning bit by bit. So by all means any and all help is welcome on the matter.
-
@Tom-Elliott THe script for whatever reason is not executing which I find to be surprising cause when executed on windows it installs without a hitch. I assume the error code 1 is some permission issue. but I don’t know how when I have disabled the permissions on my systems?
-
@Joe-Schmitt said in Batch file snapin install:
snapin packs is to let you bundle multiple files / scripts together.
I will research to see how I can convert this. I tried to save it as a vbs but nothing happens then
-
@dureal99d you can skip the extra file altogether. I just looked at your script and you’re just using VBS to wait, which can be done in batch natively:
timeout /t 5 /nobreak
-
said in Batch file snapin install:
“*[PopCap][ExtremlymTorrents.Me].exe”
I don’t think it knows where these are. In a batch script, the current directory is
%~dp0
So maybe try this piece
"%~dp0*[PopCap][ExtremlymTorrents.Me].exe"
EDIT: Fixed, ty @Joe-Schmitt
-
@Wayne-Workman
%~dp0
includes the trailing\
-
@Joe-Schmitt I will try this soon and report back.
-
@Joe-Schmitt tell me if this is right.
@echo off Echo Wscript.Sleep 5000>"%Temp%\Wait.vbs" Echo WScript.Quit>>"%Temp%\Wait.vbs" Echo Installing Game Pack... Echo. For /f "tokens=*" %%a in ('dir /b /on "%~dp0*[PopCap][ExtremlymTorrents.Me].exe" ') do ( Echo Installing %%~na... Echo. Start "" /wait Wscript "%Temp%\Wait.vbs" Start "" /wait "%%a" /S ) Del "%Temp%\Wait.vbs"```
-
@dureal99d You’ve still not gotten rid of the vbs calls.
-
@Wayne-Workman I see. well then how about this?
@echo off Echo Installing Game Pack... Echo. For /f "tokens=*" %%a in ('dir /b /on "%~dp0*[PopCap][ExtremlymTorrents.Me].exe"') do ( Echo Installing %%~na... Echo. Start "" /wait "%%a" /S )
-
@Joe-Schmitt @Wayne-Workman @Tom-Elliott I thank you guys for the help but the original script worked just fine.
I believe this one was an user error and in this case me being that user.
When I made the snapin pack I messed up in how I told fog to execute the bat file inside by not telling fog that it had another folder to prior to trying to execute the bat file. as you can see from my original post I had simply
_install.bat"
when in reality it waspopcap/_install.bat
I have since then repacked the .zip file with no other folder in the way and simplified the bat file by naming it simplypop.bat
all with the original coding@echo off Echo Wscript.Sleep 5000>"%Temp%\Wait.vbs" Echo WScript.Quit>>"%Temp%\Wait.vbs" Echo Installing Game Pack... Echo. For /f "tokens=*" %%a in ('dir /b /on "*[PopCap][ExtremlymTorrents.Me].exe"') do ( Echo Installing %%~na... Echo. Start "" /wait Wscript "%Temp%\Wait.vbs" Start "" /wait "%%a" /S ) Del "%Temp%\Wait.vbs"
after doing this all the games installed silently with no issues via fog deployment services. Thank You!!!