Auto running .bat / batch file after imaging
-
Hello everyone, can you help me?
I just created .bat / batch file, and I already tried that file, and that fine/running smoothly. And now, I put on Snapin.Just want to ask, what a best to fill up “Snapin Run With” and “Snapin Run With Argument” for .bat file, if I want to auto-running after finishing imaging.
it’s just a simple script for auto-add printer.
Thanks
-
@rivaldydwi I can’t help you with snapins since I don’t use them, but windows itself has a spot to place a batch file that will run just after OOBE/WinSetup and before the first login prompt is displayed.
For this auto execution of the batch file to work you must sysprep your image. If you use sysprep them you can create a batch file called setupcomplete.cmd and place it in a special location. If windows finds that batch file in that location it will run it. Google “windows setupcomplete.cmd” and it will give you directions where to save the file and its exact naming requirements.
The second place you can use if your commands need to have an active desktop is in the unattend.xml file. You can configure the unattend.xml file to auto login as an administrator account, X number of times. There is a section in the the unattend.xml file for firsts run actions. You can have it run 20 different commands if you want. Typically I will set the auto login count to 1 and then the last step in the first run section is to run “shutdown -r -t 0” to reboot the computer.
I know its not what you are looking for with the snapins, but this is an alternate “windows” way to go about it.
-
@george1421 Hi George, thanks for helping. At first, I also thought the same thing. I can put it on unattend.xml or with OOBE.
But I think it’s better if I put it on snapin because I have 2 different .bat files. And for the some case, I just deploy by snapin on FOG.
Just want to know, what the best “Run With” and “Argument” to put in snapin.
-
@rivaldydwi Snapins are utilities to run a script, install a program, or what have you…
Generally, speaking, you would use the Snapin Run With of
cmd /c
with.bat
scripts, but this isn’t strictly necessary..bat scripts ARE executable by nature and can be completely void ofr SRW/SRWA.
If your bat file is expecting its own arguments, this is what you would run Snapin Run With Argument.