• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 390
  • Last Modified:

where do i place a batch file for login

where do i place a batch file to run at login?
2 Solutions
Christopher McKayCommented:
Is this on a network, or just on the local machine?

On the local machine you could put it in
C:\Documents and Settings\All Users\Start Menu\Programs\Startup

If it's on a network, you could put it in
and reference it in the logon file in AD User accounts.

Hope this helps!


You can put an entry in the windows registry to make it call the batch file each time the OS starts.
The location is: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run.
Inside this Key, create a new String Value and name it. (the name does not matter).
Double click the just created string value and in its value put the full path for your batch file. For example:
"c:\documents and settings\user\Desktop\mybatch.bat".
If it is a domain account, place the batch file in the Windows\sysvol folder, ex: C:\Windows\SYSVOL\domain\scripts -- then identify the name of the batch file in the properties of the User Account in ADUC > Profile tab > logon script.
The short answer everyone is hinting at is anywhere. So long as the user logging on has Read and Execute permissions.

It does make a differance depending on if you talking for a Domain computer or stand alone workstation.

For a Domain one typical place is the \\DomainName\NETLOGON folder. Though again it can be any share that the user has the afore mentioned permissions to. Just point the Group Policy Object (GPO) to the appropriate folder where the script has been saved.

For a local computer only I would run GPEdit.msc and add the scripts there. This will ensures the Registry is updated properly (though you can do this manually as was suggested). Otherwise they probably wouldn't run.
The folder where the scripts are stored through gpedit (for flavors of NT) should be;
%SystemRoot%\system32\GroupPolicy\Machine\Scripts then either StartUp or Shutdown
%SystemRoot%\system32\GroupPolicy\User\Scripts then either Logon or Logoff
Again though via the GPEdit.msc you can point the scripts to any folder where the permissions have been set.
Just make sure the users do not have modify or write permissions or they could alter your scripts.


Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now