Computing.Net > Forums > Programming > XCOPY - Batch Help

XCOPY - Batch Help

Reply to Message Icon

Original Message
Name: Tezdread
Date: July 26, 2004 at 14:49:17 Pacific
Subject: XCOPY - Batch Help
OS: Win2k WS
CPU/Ram: NA
Comment:

Hi all,

I'm trying to use the xcopy command in a batch file and for some reason it wont work ;-/

this is what I have in the batch file

xcopy "x:\Some Dir1\Sub Dir1\Sub Dir1\Sub Dir1\Dir1\Day-DD-MM-YYYY-XXX_Archive_File.001.Z" "x:\Some Dir1\Sub Dir1\Sub Dir1\Sub Dir2\Dir2"

Unfortunately all the directories have spaces in the names so I have to use the quotation marks.

If I type that into the command line it works but it also opens the file in Winzip, which isn't wants meant to happen??

Can anyone help?



Report Offensive Message For Removal


Response Number 1
Name: Mechanix2Go
Date: July 26, 2004 at 19:50:20 Pacific
Subject: XCOPY - Batch Help
Reply: (edit)

Hi,

'Won't work' means that it does not do the copy?

If so, any error msg?



Report Offensive Follow Up For Removal

Response Number 2
Name: Tezdread
Date: July 27, 2004 at 02:58:24 Pacific
Subject: XCOPY - Batch Help
Reply: (edit)

the problem seemed to be connected to the network I was running it over yesterday.

Back in the office the copying works fine however I then run into another problem...what I can only think is 'Time'

I use the copy instead of xcopy and this is what I have so far.
----
copy "o:\team folders\support teams\opps supp\knowledge Engineer\transcripts\Mon-??-??-????-WSS_Transcript_Log.001.Z" "c:\temp\self service\wss
kb\Mon-??-??-????-WSS_Transcript_Log.001.Z"
gzip -d "c:\temp\self service\wss kb\Mon-??-??-????-WSS_Transcript_Log.001.Z" "c:\temp\self service\wss kb"
---

When I say the problem is time, I think this because when gzip tries to run but fails saying it can't find the file, but the file is copied over?? How can I make sure that gzip only runs after the file has been completely copied?


Report Offensive Follow Up For Removal

Response Number 3
Name: Mechanix2Go
Date: July 27, 2004 at 04:45:46 Pacific
Subject: XCOPY - Batch Help
Reply: (edit)

Hi,

With paths that long, it's a wonder anything works.

But to answer your question, if you know about how long the copy takes, use CHOICE.COM from 98se [works in 2k] and delay the batch long enough for the file to be copied and be available to gzip. Nickey-nouse, but effective.

Or, do:

if exist o:\filename.ext do gzip [blah blah]

M2

Mechanix2Go@Golden-Triangle.com



Report Offensive Follow Up For Removal

Response Number 4
Name: Tezdread
Date: July 27, 2004 at 14:36:10 Pacific
Subject: XCOPY - Batch Help
Reply: (edit)

I couldn't find the choice.com file on the system si I'm gonna have to look at the IF option although I'm not to sure of this so any examples anyone might have would be nice?

I'm also looking into using the AT cpmmand but I\m unsure if this will work if I'm not logged into the PC?


Report Offensive Follow Up For Removal

Response Number 5
Name: Tezdread
Date: July 27, 2004 at 14:45:24 Pacific
Subject: XCOPY - Batch Help
Reply: (edit)

ah yeah the reason why I'm not sure if it will work if I'm not logged in is because of the mapped drives and access to them without valid user details...guess that\s more to do with Windows permissions rather than programing / scripting


Report Offensive Follow Up For Removal


Response Number 6
Name: Mechanix2Go
Date: July 27, 2004 at 20:45:23 Pacific
Subject: XCOPY - Batch Help
Reply: (edit)

Hi,

Yes. Access to a mapped drive is a separate issue.

Send me an email and I'll send you a delay utility.

M2

Mechanix2Go@Golden-Triangle.com



Report Offensive Follow Up For Removal

Response Number 7
Name: Tezdread
Date: July 28, 2004 at 14:02:11 Pacific
Subject: XCOPY - Batch Help
Reply: (edit)

nice one : Mechanix2Go

I can't get the AT command to work (o anything even logged in as admin?)

I also found a Win2k version of SCHTASKS that I might try but most of the systems are still WinNT (soon to be upgraded) so this doesn't help to much at the mo...


Report Offensive Follow Up For Removal






Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: XCOPY - Batch Help

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




How often do you use Computing.Net?

Every Day
Once a Week
Once a Month
This Is My First Time!


View Results

Poll Finishes In 2 Days.
Discuss in The Lounge