Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Vista Newsgroups > Vista file management

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

Reply
 
Old 11-17-2008   #1 (permalink)
Nick Payne


 
 

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

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


My System SpecsSystem Spec
Old 12-14-2008   #2 (permalink)
R. C. White


 
 

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

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.
Quote:

> 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@xxxxxx
Microsoft Windows MVP
(Running Windows Live Mail 2008 0908 in Win7 x64 6801)

"Nick Payne" <someone@xxxxxx> wrote in message
news:e19zfhPSJHA.4680@xxxxxx
Quote:

> 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
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Windows Mail Defaults to 40-bit encryption Vista mail
Windows Mail Defaults Vista mail
Restoring Windows Defaults Vista installation & setup
Windows Explorer Defaults Vista performance & maintenance
BUG? (Test-Path $path -IsValid) and empty $path PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46