Computing.Net > Forums > Disk Operating System > Batch File Help

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch File Help

Reply to Message Icon

Name: Adam
Date: March 4, 2002 at 16:15:06 Pacific
Comment:

Hey, what's a clever way to detect to see if the computer has a hard drive in it? I'm working on a batch file that I would like to work under any circumstances and if the computer has no hard drive, I would like the batch file to inform the user of that. Thanks!



Sponsored Link
Ads by Google

Response Number 1
Name: bill 2
Date: March 4, 2002 at 17:44:11 Pacific
Reply:

not that I am aware of but this would do it

rem check for C: drive
IF EXIST c:\autoexec.bat GOTO HDD
@echo You have no c: drive
go to SKP
:HDD
@echo yes you have no bananas but you have a C: drive
:SKP


0

Response Number 2
Name: tom
Date: March 5, 2002 at 07:23:54 Pacific
Reply:

Or - just in case there just so happens
not to be an autoexec.bat, you could change
the batch a bit to:

IF EXIST C:\*.* GOTO HDD


0

Response Number 3
Name: bill 2
Date: March 5, 2002 at 08:52:01 Pacific
Reply:

I like Tom's IF statement. It's fail proof.


0

Response Number 4
Name: Michael
Date: March 5, 2002 at 18:22:15 Pacific
Reply:

Actually the more correct syntax would be:

if exist c:\nul goto hdd

-Michael


0

Response Number 5
Name: no
Date: March 10, 2002 at 07:09:59 Pacific
Reply:

Get a life


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Batch File Help

basic batch file help needed www.computing.net/answers/dos/basic-batch-file-help-needed/1019.html

DOS Batch file help www.computing.net/answers/dos/dos-batch-file-help/6382.html

batch file help please www.computing.net/answers/dos/batch-file-help-please/9905.html