HTFC Forums

H.T.F.C.

How To Fix Computers





Go Back   HTFC Forums > Software Newsgroups > Windows XP

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1  
Old 03-17-2008, 01:31 PM
Richhall
 
Posts: n/a
Default 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
Reply With Quote
Sponsored Links
Fix your Windows Problems - FAST.
FREE Safe Scan Registry Check. Locate & Fix Errors in Minutes!
  #2  
Old 03-17-2008, 01:43 PM
Pegasus \(MVP\)
 
Posts: n/a
Default 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\"


Reply With Quote
  #3  
Old 03-17-2008, 01:57 PM
Richhall
 
Posts: n/a
Default Re: Error handle copying file from server

thanks!!
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error copying file or folder Annabelleminx 4444 Windows Vista 0 02-16-2008 05:59 PM
SyncToy 1.4: "Error: Access denied.Copying f:\file\from\stick to d:\hard\disk\path" Mister.Fred.Ma@gmail.com Windows XP 4 10-23-2007 03:52 AM
WMDC Changes File Date When copying file to Laptop Bob Windows Vista 4 03-28-2007 11:16 PM
Advanced INF Handle Error siasia2 XP Networking 0 06-05-2004 10:08 PM
XP to XP network "Error Copying File or Folder" John Blaustein XP Networking 2 05-18-2004 11:50 PM


All times are GMT. The time now is 11:58 AM.


Powered by vBulletin® Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
© 2004 - 2007 Web-S-Sense Pty. Ltd. Usenet and forums posts © their respective authors.
Ad Management by RedTyger