Solved

How to add computer startup script Group Policy using command line

Posted on 2009-04-02
5
2,857 Views
Last Modified: 2012-05-06
Hi,

I'm trying to make a batch script run at startup.
I know I can do it by using gpedit.msc:
Computer Configuration -> Windows Settings -> Scripts ->Startup and then add the my batch script.

I would like to do the same, but from the command line (actually from another batch script).

Does anyone know how this could be done??

Thanks!
0
Comment
Question by:snarinsky
  • 3
  • 2
5 Comments
 
LVL 3

Expert Comment

by:Dgleich
ID: 24053769
Just copy the bat file to this location
        * In Windows XP/2000/2003, the Common Startup value should be set to C:\Documents & Settings\All Users\Start Menu\Programs\Startup.

        * In Windows Vista, the Common Startup value should be set to C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup.

0
 

Author Comment

by:snarinsky
ID: 24053893
This won't work. I need to start the script when the computer starts, not when the user logs in.

If I copy the file to C:\Documents & Settings\All Users\Start Menu\Programs\Startup it will run the script only when someone (any user) logs in to Windows.
0
 
LVL 3

Expert Comment

by:Dgleich
ID: 24054242
Hmm what about making special batch file for starting login.scr and add to start your wanted batch file in the same time?
0
 

Author Comment

by:snarinsky
ID: 24054401
I'm sorry, but I didn't quite get that.

My batch file starts a service (unfortunately that's the only way I can start it). This service has to be started at computer's startup. This computer works as a server, so most likely no user will ever login to this computer directly.

This could be done by using Group Policy editor (gpedit.msc) and placing my script to Startup/Shutdown scripts (not Logon/Logoff scripts as this is another option in gpedit).

I need to do the same, but from the command line...
0
 

Accepted Solution

by:
snarinsky earned 0 total points
ID: 24092929
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

You may have already been in the need to update a whole folder stucture using a script. Robocopy does it well and even provides a list of non-updated files in a log (if asked to). Generally those files that were locked by a user or a process by the …
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now