Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

"My Documents" variable

Posted on 2006-07-18
5
Medium Priority
?
1,063 Views
Last Modified: 2006-11-18
If I wanted to write a batch file that would go to the user's my documents folder, how would I refer to the location?

For instance, to go to the directory that they are running windows out of I would try to cd to %systemroot%. Is there a corresponding variable for My Documents?
0
Comment
Question by:stakor
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 14

Expert Comment

by:Geisrud
ID: 17132755
%HOMEPATH%\my documents

Is as close as I can think of
0
 

Author Comment

by:stakor
ID: 17132790
When I do:

cd %HOMEPATH%

I end up in the root directory of C:\ . I'll check on a nother machine, in case it's something funky with this machine.
0
 

Author Comment

by:stakor
ID: 17132817
Ok, on a 2003 machine, it works just fine. On the second Win XP machine I tried, I ended up at the same point. (root directory of the drive)
0
 
LVL 21

Accepted Solution

by:
mastoo earned 1004 total points
ID: 17132868
I think this might be fairly universal:

"%USERPROFILE%\My Documents"
0
 
LVL 14

Expert Comment

by:Geisrud
ID: 17133493
As near as I can tell, what I suggested %HOMEPATH%\my documents and what mastoo suggested %USERPROFILE%\My Documents take you to the same place
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

cPanel is a Unix based web hosting control panel that provides a graphical interface and automation tools designed to simplify the process of hosting a web site. cPanel utilizes a 3 tier structure that provides functionality for administrators, rese…
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question