Batch file work differently on two different Windows XP installations

D

Don J

I've got two different copies of Windows XP installed on my System, one on
drive D: the other on drive F:. I've got a Batch file on drive C: that when
executed from the copy of Windows installed on drive D: copies a file
"GOLDEN.bat" from drive C: to a specific directory on drive D: When
executed from the copy of Windows installed on drive F: it should copy the
same file from drive C: to a directory with the same name on drive F:.
Typical lines of code are:

Set PathC=C:\(My Documents)\z (Documents)
Set PathD1=%SystemDrive%\Documents and Settings
Set PathD2=StartMenu\Programs\Startup
XCOPY /y "%PathC%\+Macros\Golden.bat" "%PathD1%\DJohansen\%PathD2%\*.*"

The enviornment variable "SystemDrive" is a system variable that is
automattically set to "D:" when executed from the copy of Windows on Drive
D:, and set to "F:" when executed from the copy of Windows on drive F:

I've copied the above four lines of code to a batch file which I've called
"BATCH.bat".
When executed from the copy of Windows installed on drive D: the file copy
is successfully made. When executed from drive F:, however, the system
displays an error message: "File not found - Golden.bat -", immediately
following display of the operation.

This is clearly a problem. The copy operation should be succesfull no
matter where it is executed from. Can anyone help me out?

Don J

---------------------------------------------------------------------------------
 
R

Rick \Nutcase\ Rogers

Hi,

When you are booted to the installation on F, the system, more specifically
your user profile, probably has insufficient privileges to access the PathC
files.

--
Best of Luck,

Rick Rogers, aka "Nutcase" - Microsoft MVP

Associate Expert - WindowsXP Expert Zone

Windows help - www.rickrogers.org
 
D

Don J

False Alarm! Unbeknownst to me when I was working in drive F: the partition
that had originally been at drive C: had been moved to drive K: I've
noticed that this happens sometimes when you install a second copy of
Windows with a second hard disk present.
Sorry!!!

Don J
 
G

Guest

test
Rick "Nutcase" Rogers said:
Hi,

When you are booted to the installation on F, the system, more specifically
your user profile, probably has insufficient privileges to access the PathC
files.

--
Best of Luck,

Rick Rogers, aka "Nutcase" - Microsoft MVP

Associate Expert - WindowsXP Expert Zone

Windows help - www.rickrogers.org
 

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

Similar Threads


Top