A Batch Script that copies a file do a network computer then logs if it was successful -



A Batch Script that copies a file do a network computer then logs if it was successful -

i have list of computer names feeding script form text file , each workstation want re-create text file desktop, want log weather or not re-create successful or not different text file, have 2 workstation names in read file 1 contactable , 1 not , getting 1 homecoming in log file , workstation name not populating.

set copied=successful set workstation=xl /f %%x in (workstations2.txt) re-create /y physicians.txt "\\%%x\c$\documents , settings\all users\desktop\physicians.txt" set workstation=%%x if errorlevel 1 set copied="not successful" echo %date% %time% file re-create %copied% %workstation% >> logfile.txt @echo completed. pause

here output log file

tue 02/19/2013 14:02:42.74 file re-create successful %x

i'm not sure why setting workstation that, works me

note parenthesis around mass of loop

set copied=successful /f %%x in (workstations2.txt) ( echo re-create /y physicians.txt "\\%%x\c$\documents , settings\all users\desktop\physicians.txt" if errorlevel 1 set copied=not successful echo %date% %time% file re-create %copied% %%x >> logfile.txt ) @echo completed. pause

batch-file

Comments

Popular posts from this blog

javascript - mongodb won't find my schema method in nested container -

r - url in CRAN extension manual -

asp.net - .NET Control.ID property inconsistency -