Results 1 to 5 of 5

Thread: Group policy and batch files

  1. #1
    Join Date
    Jul 2004
    Posts
    8

    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.

  2. #2
    Join Date
    Sep 2005
    Posts
    58

    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:

    IF EXIST \\server\share\%computername%.txt goto end
    start /w mytask.exe
    :end

  3. #3
    Join Date
    Jul 2004
    Posts
    8

    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?

  4. #4
    Join Date
    Sep 2005
    Posts
    58

    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.

  5. #5
    Join Date
    Sep 2004
    Posts
    105

    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

Similar Threads

  1. Using local group policy to override domain group policy
    By Nickason in forum Active Directory
    Replies: 3
    Last Post: 28-09-2011, 04:20 AM
  2. Replies: 5
    Last Post: 14-08-2010, 10:25 PM
  3. Replies: 3
    Last Post: 07-10-2009, 02:12 PM
  4. Replies: 3
    Last Post: 14-03-2009, 08:52 PM
  5. Group Policy -> Missing Group Policy settings
    By Jeroen in forum Active Directory
    Replies: 3
    Last Post: 24-07-2007, 11:00 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,243,563.25497 seconds with 17 queries