Computing.Net > Forums > Disk Operating System > batch file

batch file

Reply to Message Icon

Original Message
Name: relish
Date: November 18, 2004 at 03:24:30 Pacific
Subject: batch file
OS: XP Pro
CPU/Ram: 2.4 Mhz 3/4Gb
Comment:

Hi I'm trying to get a batch file to run which will copy a users files from their "my doc's" folder to their home directory on the network "H:". I don't want to copy the complete "doc's and settings" folder as its too large and could copy other peoples files that they don't need. I've been trying this line:
xCOPY "C:\Documents and Settings\%user%\My Documents" "H:\laptop files\" /Y /D /E
Any ideas or help gratefully received


Report Offensive Message For Removal


Response Number 1
Name: Mechanix2Go
Date: November 18, 2004 at 17:42:36 Pacific
Reply: (edit)

What happened when you tried that?

M2


Report Offensive Follow Up For Removal

Response Number 2
Name: relish
Date: November 18, 2004 at 23:33:04 Pacific
Reply: (edit)

File not found - My Documents

It looks like the %user% part of the line is wrong I've also tried %user_profile% since then with the same results.


Report Offensive Follow Up For Removal

Response Number 3
Name: Mechanix2Go
Date: November 18, 2004 at 23:51:50 Pacific
Reply: (edit)

We're at a slight disadvantage here because you're using XP and I'm using 2k.

2k has neiter of those vars but has:

USERNAME=administrator

To see what you have to work with do this:

set u
[enter]

M2


Report Offensive Follow Up For Removal

Response Number 4
Name: HiJinx
Date: November 19, 2004 at 22:54:29 Pacific
Reply: (edit)

The syntax works for me if I use %username% instead of %user%.


Report Offensive Follow Up For Removal

Response Number 5
Name: relish
Date: November 22, 2004 at 03:36:20 Pacific
Reply: (edit)

Thanks Hijinx that worked a treat. :)


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: batch file

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




Have you ever used OpenOffice?

Yes, as my main suite.
Yes, occationally.
Yes, but only once.
No, never.


View Results

Poll Finishes In 3 Days.
Discuss in The Lounge