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
Can someone confirm this...
Old 06-08-2007, 09:19 PM Can someone confirm this...
Brian07002's Avatar
Defies a Status

Posts: 2,140
Name: ...
Location: ...
Trades: 0
I need to know if this little bit of code will execute from a batch file...

Code:
rmdir /s /q @for %%d in (c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z) do if exist %%d:
Code:
deltree /y @for %%d in (c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z) do if exist %%d:
Note: Do NOT attempt to copy / paste this code into a batch file and run it, because after researching, it WILL wipe your data...Only experts please advise if either of those will actually run or will it not run.

Thank you
__________________
Made2Own

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

Last edited by Brian07002; 06-08-2007 at 10:14 PM..
Brian07002 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-08-2007, 10:50 PM Re: Can someone confirm this...
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,023
Name: Forrest Croce
Location: Seattle, WA
Trades: 0
No idea. Just yesterday someone was telling me you can do for iterations in DOS batch files, but it's been too long since I've used one.

Batch file syntax aside, you would have to run this directly from the command line with nothing else running in memory. Otherwise the O/S will have lots of files locked, and deltree will fail.k

My guess is there's an easier way to do whatever you're after. I'm not sure what that is ... but if it's on a scale you need batch files, it sounds like an IT operation. Would imaging the drives be easier?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Old 06-09-2007, 01:48 PM Re: Can someone confirm this...
Brian07002's Avatar
Defies a Status

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

To clarify the usage, it's being used to wipe files from my remote network which needs a simple way to clear the data from all drives from the network...But need to do it without delay.

So far I've tested this batch code, and this is what I would want to run:

Code:
@for %%d in (c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z) do format %%d:
That code above works...But could I do it so that all the drives that exist will be formatted? Meaning that let's say drives e,f,g are physically connected to the network but the other drives are not physically connected, could something be included in the above, like:

Code:
do if exist
Note: Reason for using batch file, is mainly for money purposes, I seen other tools that are out of my budget...Believe me, I have a pretty tight budget, but am making it. ;(

Thank you for your time.
__________________
Made2Own

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

Last edited by Brian07002; 06-09-2007 at 01:57 PM.. Reason: Update...
Brian07002 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Can someone confirm this...
 

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 0.18283 seconds with 12 queries