Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
How to make SUBST mapping persistent across reboots?

I want to run a batch file after Windows XP starts up. How can I do that?

My run.bat file:

  subst Z: C:\dir1\dir2\dir3\file

I put run.bat in the startup folder (C:\WINDOWS\system32\config\systemprofile\Start Menu\Programs\Startup) but the link isn’t created.

share|improve this question

marked as duplicate by Kez, Mehper C. Palavuzlar, Mokubai, ChrisF, Sathya Mar 28 '11 at 17:54

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

possible duplicate of How to make SUBST mapping persistent across reboots? - this question provides an answer to solve this exact problem without using batch files. – Kez Mar 28 '11 at 11:21
This looks similar to another question I just edited:… – Pops Mar 28 '11 at 17:23

Instead of using a batch file for this a simple registry trick makes the subst persist across reboots.

Wikipedia has how:

share|improve this answer
can you have idea in which dir I need to create the .bat file in order to run the run.bat after win startup? – jon Mar 28 '11 at 11:26
You could put the batch file anywhere and create a shortcut in the startup folder for it. Don't put the batch file itself directly in there. – Majenko Mar 28 '11 at 11:28
I did it but I get error about to open the .bat file did you sure about this? – jon Mar 28 '11 at 12:01

Try putting the .bat in the startup file

C:\Documents and Settings\User Name\Start Menu\Programs\Startup
share|improve this answer

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