Solved

How to add computer startup script Group Policy using command line

Posted on 2009-04-02
5
3,151 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How can i echo a ! to end of a file? 8 36
BgInfo help 5 108
SQL Server Database Inventory 7 28
What are the recommended security measures to put in place? 19 92
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

739 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