Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Old 06-18-2007, 03:08 PM Batch File Help...
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
Ok,

I am trying to determine what the cd-rom drive letter is, and then add some code to it from a batch file.

Here's what I have so far to determine the cd-rom drive letter:

Code:
FOR /F "tokens=3" %%A IN ('ECHO list volume ^| DISKPART.EXE ^| FIND.EXE "-ROM "') DO SET CDROM=%%A:
CLS
@echo Your CD is %cdrom%
So, If I have:
Code:
@for %%d in (c,d,e,f,g) do copy file.txt %%d:\
How could I exclude the cd-rom drive(s) or ANY drive that is NOT Ready from the above (for obvious reasons, can't copy to the drive)...I know I could just exclude the drive letters for the cd rom (non-ready) drive(s), but we change drive letters often for different reasons...Maybe not often, but we do change them.

Thank you.
-Brian
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-18-2007, 05:21 PM Re: Batch File Help...
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
In .NET or VBA or VB 6 this would be a very easy thing to do. But you're just simply needing more than you can get out of batch files.

Consider, I have five hard drives, a set of removable drives, a CD R/W drive and a DVD R/W drive. I'm sure lots of people have more than one optical.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 06-18-2007, 05:38 PM Re: Batch File Help...
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
Ok,

Then might it be at even all possible to just suppress the errors while copying if it can't copy to that drive?

Thank you
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 06-18-2007, 06:35 PM Re: Batch File Help...
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
Yeah, I'm pretty sure that's possible, although I don't remember how. I think you can set echo off to include output from file commands, and I'm almost positive you can also pipe the output into a file, and append it, so you could keep a status log that way. But I can't stress enough how much better off you'd be with a more recent technology, be it VB, C#, Windows Host Scripting, or something else. If you want to ease deployment, you could put the compiled exe file on a network share and call out to it through a batch file, so not have to install it on the client machine at all.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Batch File Help...
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.94646 seconds with 12 queries