Group policy and batch files
There are about 180 servers where I need to deploy a Batch file just once. I created that file but I don’t want to initiate the same through a startup or logon script as I said it just need to be ran one time only.
So I wanted to know if there is any alternate way running this file via GPO? Please let me know how.
Re: Group policy and batch files
Yes, there is alternate way. You can easily do this by using a registry key named "RunOnce"and provide the path to the script. But remember still you will need a script to create RunOnce key. You can make use of Script command to create the same. It should be something like this:
Quote:
IF EXIST \\server\share\%computername%.txt goto end
start /w mytask.exe
:end
Re: Group policy and batch files
Help appreciated Lavin but i think the run once key would require user intialization such as a logon, right? If yes, let me remind that i dont want to initialization such as a logon/logoff or restart. So any other suggestion please?
Re: Group policy and batch files
Ohh yeah. You are correct. Sorry for the same. RunOnce obviously requires a user login hence it is of no use for you. In other suggestion i think probably any third party software can do the job. BTW if you are on GP Preference already, you can deploy a scheduled task and start it only one.
Re: Group policy and batch files
I'm not sure but i can say that creating a text file with the listing of target servers (one per line) and execute the following from the Command
Prompt may help you. Just give it a try:
FOR /F %i in (c:\temp\ServerList.txt) DO COPY RunMe.cmd \\%i\c$ /Y
FOR /F %i in (c:\temp\ServerList.txt) DO AT \\%i 22:00 c:\RunMe.cmd
Here note that i assume it's C:\Temp\ServerList.txt) and you want to execute
it at 10PM. You must also check this Microsoft KB for more info: http://www.microsoft.com/technet/scr...4/hey0922.mspx