Need to open explorer to folder in "My Documents" via command line

R

Ralph Malph

I need to be able to open an explorer window showing a folder found in the
users "My Documents" folder. I need to do this via a .bat file. I know I can
use variable like %userprofile% to find the users profile folder under
"Documents and Settings" but on some of the systems where I need this
function "My Documents" will not be found under "Documents and Settings". For
example I have several PCs where it is found at the root of drive U. (A
thawed part of a frozen computer). Whether "My Documents" is found in a
profile folder under "Documents and Settings" or ANY OTHER place on the
system I need to be able to have an explorer window open up to it. I am
currently using the following line in a .bat file, but it only works if My
Documents is under the users profile folder which is not always the case.

%windir%\explorer.exe "%userprofile%\my documents\AXIS Media Control -
Recordings"

How can I write a simple script/.bat/cmd file that, no matter who is logged
on or where they have their "My Documents" folder at I can open an explorer
window to a specific folder in it. I also need this to work even if they
change their "My Documents" folder location via right clicking on the "My
Documents" icon and via its properties windows changing its location. Word
and other programs can deal with this so there must be a way unless Microsoft
had another one of their all to often MBD (Microsoft being dumb) days when
designing this part of the system.

Thanks for the help,

Ralph Malph
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top