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.

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: superuser.com/questions/263545/… –  Pops Mar 28 '11 at 17:23

2 Answers 2

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

Wikipedia has how: http://en.wikipedia.org/wiki/Subst#Persisting_across_reboots

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
1  
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.