|
Answer» Good afternoon everyone, I am new to this site and hope someone can assist me in this issue. i have spoken to several admins and i get conflicting commands. so here goes. i have a batch file that i put into the login script of the gpo to be pushed out to all of the computers. the batch file is simple and runs a registry file, stops the print spooler and RESTARTS it, then refreshes the print spooler. once it is complete it updates the group policy. batch file: regedt32 /s printers.reg
net stop spooler net start spooler
gpupdate /force
it WORKS great but upper management wants to add a couple commands. they want to copy the reg file to the computers on the domain and for the batch file to run only once and force a restart of the computer. /boot command sends the computer into a endless LOOP of rebooting. so that doesn't work well. does anyone know the if else statement to complete this? or the commands to work this issue?
any assistance in this matter would be greatly appreciated.Easiest method would be 2 batch files.
Batch1 - Runs the processes that are desired and calls for execution of Batch2 to start, with Batch 1 ending.
Batch2 - Deletes Batch1 and gives the system the reboot command.
- System processes what you need and only reboots once because Batch1.bat no LONGER exists at the location that causes the boot/reboot loop. Batch2.bat needs to be located in a location outside of a STARTUP area so that it would not be triggered on boot to execute.
* Above works if you plan on 1 time use of logon script per machine, and then removing this logon script from this happening with consecutive logons.
|