aikido Posted August 9, 2007 Share Posted August 9, 2007 Hi, I am in the process of writing an autorun file for a usb. I am needing help with my batch file. What i am looking for is a batch file command that will open the root of the usb device in windows explorer. For example the autorun will point to a batch file that will run a program and then also open a windows explorer window displaying the root of the device it is running from??? Can anyone help???? Quote Link to comment Share on other sites More sharing options...
Sparda Posted August 9, 2007 Share Posted August 9, 2007 explorer . Quote Link to comment Share on other sites More sharing options...
aikido Posted August 9, 2007 Author Share Posted August 9, 2007 Sorry i should explain more. I need to open the route of the usb in a window, just as if the pen drive was inserted and has run normally. Hope this makes sense. Quote Link to comment Share on other sites More sharing options...
Sparda Posted August 9, 2007 Share Posted August 9, 2007 explorer . will do that Quote Link to comment Share on other sites More sharing options...
aikido Posted August 9, 2007 Author Share Posted August 9, 2007 Sorry Sparda, I am still not been clear about this. the main problem is that how do i tell the batch file the drive letter as this will vary from machine to machine, or will explorer automatically take it to the root of the usb device? i tried this and it opened up the my documents folder on C drive??? Quote Link to comment Share on other sites More sharing options...
aikido Posted August 9, 2007 Author Share Posted August 9, 2007 I got the answer it is:- START explorer.exe %~d0 But thanks for your help.... Quote Link to comment Share on other sites More sharing options...
Sparda Posted August 9, 2007 Share Posted August 9, 2007 explorer . opens the current working directory, if the script originates from the root directory of your removable drive, then that will be the working directory. Quote Link to comment Share on other sites More sharing options...
natural_orange Posted August 9, 2007 Share Posted August 9, 2007 start that will open the root of drive that the batch file is running from in an "explorer" window Quote Link to comment Share on other sites More sharing options...
punko Posted October 23, 2007 Share Posted October 23, 2007 start. will work the best Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.