Path defaults to c:\windows\system32 when using Run as Administrator

Posted: 11-17-2008, 09:06 PM
A have a couple of backup cmd files using relative paths. If I double-click
on them in Windows Explorer then they run using as the default path the
location of the cmd file, which is what I want. This worked fine on XP, but
on Vista I have to run the cmd files as administrator for some of the copies
to succeed. However, if I right-click on the cmd file and select "run as
administrator", it seems to use the default path of c:\windows\system32
rather than the cmd file location, because I find that files are getting
copied to paths under c:\windows\system32 rather than under the location of
the cmd file.

I don't want to put in absolute paths because the cmd files are located on
and the copies are to external USB drives that don't always have the same
drive letter. Is there a solution to the problem other than running a cmd
window as administrator, changing path in the cmd window to the external
drive, and running the cmd file that way - this is hardly a user interface
improvement over XP.

Nick

Path defaults to c:\windows\system32 when using Run as Administrator


Responses to "Path defaults to c:\windows\system32 when using Run as Administrator"

R. C. White
Guest
Posts: n/a
 
Re: Path defaults to c:\windows\system32 when using Run as Administrator
Posted: 12-15-2008, 02:57 AM
Hi, Nick.

Your post is nearly a month old and you may have already solved your
problem. If not, maybe I can help with a couple of comments.

This is a job for Disk Management, it seems to me.
> and the copies are to external USB drives that don't always have the same
> drive letter.
I've never used USB hard drives, but I have several USB flash drives (and a
USB SD card reader). If I don't assign my choice of letters, then Vista
assigns "the next available letter" each time I plug them in. So I've
assigned letters for them in Disk Management and they get the same letters
when I unplug them and plug them in again. In other words, my ReadyBoost
drive is always R:; my SD card reader is always S:.

I've assigned the often-overlooked letter B: to a USB flash drive that I use
to back up some small-but-critical files. I don't use a backup program, but
a batch file, which I think is what you are using. I've created and edited
the WeekBat.bat file with Notepad and stored it on Drive B:. It has
instructions to Xcopy specific files and folders from my hard drives to
specific places on Drive B:. Each week, I plug in the USB drive, navigate
to B:\WeekBak.bat and click on it. When it is done, I unplug Drive B: and
put it back in the safe. My 8 GB flash drive has about 6 GB free now.

You didn't say how big your files are, or how many different locations are
involved, but this might give you some ideas that you can adapt to your own
situation.

RC
--
R. C. White, CPA
San Marcos, TX
rc@grandecom.net
Microsoft Windows MVP
(Running Windows Live Mail 2008 0908 in Win7 x64 6801)

"Nick Payne" <someone@nowhere.au> wrote in message
news:e19zfhPSJHA.4680@TK2MSFTNGP06.phx.gbl...
> A have a couple of backup cmd files using relative paths. If I
> double-click on them in Windows Explorer then they run using as the
> default path the location of the cmd file, which is what I want. This
> worked fine on XP, but on Vista I have to run the cmd files as
> administrator for some of the copies to succeed. However, if I right-click
> on the cmd file and select "run as administrator", it seems to use the
> default path of c:\windows\system32 rather than the cmd file location,
> because I find that files are getting copied to paths under
> c:\windows\system32 rather than under the location of the cmd file.
>
> I don't want to put in absolute paths because the cmd files are located on
> and the copies are to external USB drives that don't always have the same
> drive letter. Is there a solution to the problem other than running a cmd
> window as administrator, changing path in the cmd window to the external
> drive, and running the cmd file that way - this is hardly a user interface
> improvement over XP.
>
> Nick
 
LinkBack Thread Tools Display Modes
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot find C:\Windows\System32\System32.exe JR Windows XP New Users 2 05-08-2004 03:25 AM
adding path to windows search path * ProteanThread * Windows XP Basics 2 04-23-2004 07:04 PM
computer can not find c:\windows\system32\system32 exe colin Windows XP Help & Support 1 01-13-2004 05:49 PM
windows cannot find 'c:\windows\system32\system32.exe' Theresaw Windows XP Performance & Maintenance 2 10-23-2003 03:25 AM
Windows XP Home with windows/system32 or winnt\system32 George Atkinson Windows XP Setup 0 09-28-2003 05:38 PM