Shortcut with %USERPROFILE% AND embedded spaces in target path

G

Guest

I want to define a desktop shortcut that launches Explorer in the user's
"%USERPROFILE%\Application Data" directory.

If I enter it as above (with the %USERPROFILE% inside the quoted string), I
get a "Name not valid" error. If I leave off the quotes, it opens Explorer
in the USERPROFLIE directory and not the "%USERPROFILE%\Application Data"
directory. It is probably seeing the embedded space, trying to go to
"%USERPROFILE%\Application", not finding it, so staying in the USERPROFILE
directory.

I've tried every variation on quotes, single quotes, back quotes, extra
percent signs, ... and nothing seems to work.

Can someone please enlighten me to the magic incantation that will
concatenate the two parts of the target path?? ;-)
 
W

Wesley Vogel

Right click Desktop, point to New, click Shortcut, type: %appdata% in the
box, click Next, click Finish. Application Data shortcut to
%USERPROFILE%\Application Data created.

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
 
N

Nepatsfan

bill said:
I want to define a desktop shortcut that launches Explorer in the user's
"%USERPROFILE%\Application Data" directory.

If I enter it as above (with the %USERPROFILE% inside the quoted string), I
get a "Name not valid" error. If I leave off the quotes, it opens Explorer
in the USERPROFLIE directory and not the "%USERPROFILE%\Application Data"
directory. It is probably seeing the embedded space, trying to go to
"%USERPROFILE%\Application", not finding it, so staying in the USERPROFILE
directory.

I've tried every variation on quotes, single quotes, back quotes, extra
percent signs, ... and nothing seems to work.

Can someone please enlighten me to the magic incantation that will
concatenate the two parts of the target path?? ;-)

Have you tried entering the following in the target line of your shortcut?

%windir%\explorer.exe /e,%USERPROFILE%\Application Data

Note: No quotes and only one space between exe and /e,

Good luck

Nepatsfan
 
W

Wesley Vogel

I do not have %USERPROFILE%\Local Settings\Application Data\Microsoft Help

I do have %USERPROFILE%\Local Settings\Application Data\Microsoft\HelpCtr

Navigate to %USERPROFILE%\Local Settings\Application Data\Microsoft\HelpCtr,
right click on HelpCtr, Point to Send To and click on Desktop (Create
shortcut).

Or right click Desktop, point to New, click Shortcut, paste this in the box:

%windir%\explorer %USERPROFILE%\Local Settings\Application
Data\Microsoft\HelpCtr

click Next, click Finish.

That line probably wrapped, one space only, between explorer AND
%USERPROFILE%


Explorer.exe Command-Line Options for Windows XP
http://support.microsoft.com/kb/314853

HOW TO: Customize the Windows Explorer Views in Windows XP
http://support.microsoft.com/kb/307856

HOW TO: Have Windows Explorer Default to the %SystemRoot% Drive When Started
http://support.microsoft.com/kb/257518

HOW TO: Change Windows Explorer Default View to My Computer
http://support.microsoft.com/kb/221878

How to open folder in single pane when using the "Winkey + E" combination
http://windowsxp.mvps.org/winkeye.htm

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
 
W

Wesley Vogel

The line did wrap.

%windir%\explorer %USERPROFILE%\Local Settings\Application
Data\Microsoft\HelpCtr

Correction. Would you believe that there are two spaces.

One space between explorer AND %USERPROFILE% & one space between
Application AND Data.

%APPDATA% is the varibale for %USERPROFILE%\Application Data

There is no variable for %USERPROFILE%\Local Settings\Application Data

Or try this, right click Desktop, point to New, click Shortcut, paste this
in the box:

%USERPROFILE%\LOCALS~1\APPLIC~1\MICROS~1\HelpCtr

click Next, click Finish.

%USERPROFILE%\LOCALS~1\APPLIC~1\MICROS~1\HelpCtr has no spaces, so it works
without using %windir%\explorer.

Using quotes like this also works..
"%USERPROFILE%\Local Settings\Application Data\Microsoft\HelpCtr"
in the location box in New\Shortcut.

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
 
W

Wesley Vogel

Also see my Correction. Would you believe that there are two spaces.
post in this thread. ;-)

Confusion say, "Many ways to skin cat."

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
 

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