Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I copy files to a Network Place from a script or the command line? [closed]

Is it possible, in Windows XP, to copy files to a Network Place from the command line, a batch file or, even better, a PowerShell script?

What sent me down this road of research was trying to publish files to a WSS 3.0 document library from a user's machine. I can't map a drive to the library in question because the WSS site is only available to authenticate via NTLM on a port other than 80 or 443. I suppose I could alternately use the WSS web services to push the files out, but I'm really curious about the answer to this question now.

like image 425
Abs Avatar asked Aug 13 '08 20:08

Abs


2 Answers

Using a batch file, you can both log on to the resource and copy the file:

The Batch File would contain the following:

net use \\{dest-machine}\{destfolder} {password} /user:{username}
copy {file} \\{dest-machine}\{destfolder}

e.g.

net use \\Development\myfolder mypassword /user:Administrator
copy newfile.c \\development\myfolder
like image 165
seanyboy Avatar answered Oct 03 '22 05:10

seanyboy


If you are referring to a windows box, just use xcopy. It is pretty standard to have xcopy available.

xcopy src \\dest-machine\shared-library-name\dest
xcopy \\src-machine\shared-library-name\dest src
like image 38
jetzdax Avatar answered Oct 03 '22 04:10

jetzdax