PDA

View Full Version : Copying a file/s from C: to a Server using a batch (WNT)



schmoo1
06-25-2002, 03:32 PM
I need help please.

I have a batch file that runs an NT Command Script minmized which in turn is supposed to copy contents of My Documents from C: to a Server and it isn't working, why?
Experience of scripts is limited!

Should the following work?

@echo off
copy c:\My Documents\<document name/s>
\\<server name>\path\<document name/s>
@cls
exit

If it should, it isn't!

Cheers

jdharm
06-25-2002, 03:38 PM
Unless you have created it, I don't believe NT has a "My Documents" folder. The folder that serves that purpose under NT4 is C:\WINNT\Profiles\<username>\Personal.

And if there is a "My Documents" folder then you will need to enclose the entire path in quotes so that the space in "My Documents" will be taken as part of the name and not a break in the command.

Josh

"Eagles may soar, but weasels don't get sucked into jet engines."

schmoo1
06-25-2002, 03:49 PM
My Documents has been created and I'll give it a go and let you know.

Thanks

schmoo1
06-25-2002, 04:08 PM
Just tried the following with no success, can you point were I am going wrong?

In the common.bat that runs the NT Command Script, I have:

start /min common.cmd

In the NT Command Script:

@echo off
copy c:\"My Documents"\test.txt
c:\"My Documents"\test2.txt
@cls
exit

Tried various ways, were am I going wrong?

Cheers

guyver_news
06-25-2002, 05:00 PM
the quotes are in the wrong place,

try something like this:

copy "c:\my documents\testfile.txt" c:\temp

HTH

schmoo1
06-26-2002, 09:25 AM
Appears to have worked!
Many thanks.

Can the same method be used for Windows 2000?

Cheers