![]() |
|
|
Welcome to the { mindfrost82.com } forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Error handle copying file from server
Hi
To ensure I have the latest file for something, when i run a .cmd to start it, I simply copy the file from a central PC when the .cmd is run on my PC. (the application is started on a few PCs). The problem is, it the file is unavailable or the server is unavailable then the application won't start. What is the best way of handling this without negatively affecting the startup time too greatly please? example so far @echo off net use J: /d net use J: \\server\share$ xcopy "J:\server\file1.txt" "C:\Myapp\" /S /Y net use J: /d /y Cheers Rich |
|
|||
|
Re: Error handle copying file from server
"Richhall" <rje.hall@yahoo.co.uk> wrote in message news:13926e7a-9fd3-476a-9757-e665df30a161@d21g2000prf.googlegroups.com... > Hi > > To ensure I have the latest file for something, when i run a .cmd to > start it, I simply copy the file from a central PC when the .cmd is > run on my PC. (the application is started on a few PCs). The > problem is, it the file is unavailable or the server is unavailable > then the application won't start. What is the best way of handling > this without negatively affecting the startup time too greatly please? > > example so far > > @echo off > net use J: /d > net use J: \\server\share$ > xcopy "J:\server\file1.txt" "C:\Myapp\" /S /Y > net use J: /d /y > > > Cheers > > Rich You could do it like so: @echo off ping server -n 2 | find /i "bytes=" > nul || goto :eof xcopy /s /y /c /d \\Server\Share$\file1.txt" "C:\Myapp\" |
![]() |
|
| Thread Tools | Search this Thread |
| Display Modes | |
|
|