Solved

How to add computer startup script Group Policy using command line

Posted on 2009-04-02
5
3,032 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
User profile Size Report 3 83
Which browser works with XP 16 307
Copy dir and files with robocopy 2 64
Auditing domain account logon attempt, failure, lockout 2 117
Learn about cloud computing and its benefits for small business owners.
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

809 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