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

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

batch file

Reply to Message Icon

Name: relish
Date: November 18, 2004 at 03:24:30 Pacific
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



Sponsored Link
Ads by Google

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

What happened when you tried that?

M2


0

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

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.


0

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

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


0

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

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


0

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

Thanks Hijinx that worked a treat. :)


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: batch file

Help!! Batch File www.computing.net/answers/dos/help-batch-file/13525.html

Batch files - - Mapping network drive www.computing.net/answers/dos/batch-files-mapping-network-drive/3809.html

Pause batch file www.computing.net/answers/dos/pause-batch-file/2810.html