I am trying to write a simple Batch File to launch an exe using some basic CMD PRMPT functions. I know exactly what I need to do, but my only problem is I don't know how to detect the Desktop Folder? What if its in Documents and Settings, or if they have a newer computer in Users? Ty for any help :)
MasterGberry -3 Posting Whiz in Training
Recommended Answers
Jump to PostI'm not sure you've posted in the correct forum, I think you want the shell scripting forum!
Anyway, I think what you're after is this:
%USERPROFILE%\Desktop
So if you wanted to navigate into the current users Desktop folder in your .bat file, then you would use:
…
All 3 Replies
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
MasterGberry commented: Perfect C++ Example :) +0
JasonHippy 739 Practically a Master Poster
Ancient Dragon commented: So I used the correct environment variable afterall :) +35
MasterGberry commented: Perfect explanation :) +0
MasterGberry -3 Posting Whiz in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.