WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: pamsniffer on February 27, 2015, 01:11:51 AM

Title: filecopy between servers did not work
Post by: pamsniffer on February 27, 2015, 01:11:51 AM
Hi,

I have tried to copy files between servers that, but for some reason it did not work.

FileCopy("\\server1\c$\temp*.txt", "\\server1\c$\temp", @FALSE)


Pam
Title: Re: filecopy between servers did not work
Post by: stanl on February 27, 2015, 03:53:00 AM
Pam;

If you set the last parm to @TRUE, your should get a warning about over writing and at least know the other parameters were correct. 
Title: Re: filecopy between servers did not work
Post by: nrr on February 27, 2015, 04:51:49 AM
Pam ... paste '\\server1\c$\' into an Windows Explorer window and see if it opens to the expected location and see if there are and *.txt files there.  Also, it appears that you're just copying all the *.txt files back to the same server.  Is that what you intended?  Try copying the files to a different folder and see if that works.
Title: Re: filecopy between servers did not work
Post by: pamsniffer on February 27, 2015, 05:17:01 AM
Sorry type

FileCopy("\\server1\c$\temp*.txt", "\\server2\c$\temp", @FALSE)
Title: Re: filecopy between servers did not work
Post by: pamsniffer on February 27, 2015, 07:03:12 AM
hi,

for some reason this script is not working, unc copt seem not to work.

server="\\2012\c$\"
servernaam="\\2012"

AddExtender('wwwnt34i.dll')
debug(@on)
runwait("net.exe"," use e: %server% /user:admin  admin")
delay(3)
DirMake("%server%tempold")
filecopy("ump.bat", "%server%tempold",@false)
filecopy("ha.ps1","%server%tempold",@false)
runwait("psexec","%servernaam% -w c:\tempold cmd.exe /c c:\ump.bat")
filecopy("%server%tempold\*UMP*.*","d:\",@false)
filedelete("%server%tempold\*WIND*.*| *UMP*.* | hal.*",@false)
DirRemove("%server%tempold")



pam