Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How can I write Windows XP logon batch files? Do you have any examples of such files?

share|improve this question

closed as not a real question by grawity, Breakthrough, random May 2 '11 at 12:20

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

    
I suppose one would write a bat file put it in the startup folder and then the command prompt window comes up minimised and runs it. –  barlop May 1 '11 at 14:48

2 Answers 2

It really depends on what you are trying to achieve (change machine/user settings, map network drives, etc. ). Microsoft website has a great number of examples, so do others.

By and large the order of actions goes like this:

  1. Create a logon script file.
  2. Modify local security policy (Control Panel\Admin Tools\Local Sec Pol) to you the script you just created for either machine or user.
  3. Test.

Please be a bit more specific on desired outcome and I'll do my best to help you.

share|improve this answer

As Tavvi said above, it depends on what exaclty you want the batch file to do. They can be used to map a network drive or change user settings. Batch file scripting can range from very simple (list file in a folder, and save to a file) and range to very complex (with menus, user interaction).

For a sample .bat file, open up notepad and type in

DIR /S > c:\sample.txt.

then save the text file and rename it from ".txt" to ".bat" and run it. This will list all folders in the working directory and save them in a text file on the root of the C:\ drive. You could then put this in a startup folder and it would run when the user logs in.

Bear in mind cmd-line and batch files can be very powerful and can easily cause damage if they are not written and tested properly.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.