1

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.

jon
  • 75
  • 2
  • 3
  • 6
  • possible duplicate of [How to make SUBST mapping persistent across reboots?](http://superuser.com/questions/29072/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: http://superuser.com/questions/263545/how-can-i-make-a-vb-script-execute-every-time-windows-starts-up – Pops Mar 28 '11 at 17:23

2 Answers2

1

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

Majenko
  • 32,128
  • 4
  • 61
  • 81
  • 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
0

Try putting the .bat in the startup file

C:\Documents and Settings\User Name\Start Menu\Programs\Startup
Tamara Wijsman
  • 57,083
  • 27
  • 185
  • 256
Matt
  • 583
  • 4
  • 9