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.

link|improve this question

40% accept rate
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/… – Lord Torgamus Mar 28 '11 at 17:23
feedback

closed as exact duplicate by kez, Mehper C. Palavuzlar, Mokubai, ChrisF, Sathya Mar 28 '11 at 17:54

This question covers exactly the same ground as earlier questions on this topic; its answers may be merged with another identical question. See the FAQ for guidance on how to improve it.

2 Answers

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

link|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
feedback

Try putting the .bat in the startup file c:\Documents and Settings\User_name\Start Menu\Programs\Startup

link|improve this answer
feedback

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