where do i place a batch file for login

Posted on 2007-08-09
Last Modified: 2013-11-05
where do i place a batch file to run at login?
Question by:al4629740
    LVL 22

    Accepted Solution

    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!


    LVL 2

    Expert Comment

    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".
    LVL 19

    Expert Comment

    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.
    LVL 9

    Assisted Solution

    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.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
    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…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    779 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

    16 Experts available now in Live!

    Get 1:1 Help Now