Sign in with
Sign up | Sign in
Your question

If then statement in windows 7 64bit annoying message

Tags:
  • Windows 7
  • Windows XP
Last response: in Windows 7
Share
November 28, 2012 3:29:31 PM

I have a super simple bat file that pretty much looks like this:

if exist d:\*.* echo D is available
if exist e:\*.* echo E is available
if exist f:\*.* echo F is available

It works in XP. It works on MY Win 7 64bit machine.

BUT if I run it on my father-in-lawy's Win7 64bit machine, a system message pops up saying it can't find the drive. If I click Continue, the message persists until I hit Continue multiple times.

Anyone know what is going on here? How do I prevent this message from happening?

Thanks!

Bruce


More about : statement windows 64bit annoying message

November 28, 2012 3:41:39 PM

bkorn said:
I have a super simple bat file that pretty much looks like this:

if exist d:\*.* echo D is available
if exist e:\*.* echo E is available
if exist f:\*.* echo F is available

It works in XP. It works on MY Win 7 64bit machine.

BUT if I run it on my father-in-lawy's Win7 64bit machine, a system message pops up saying it can't find the drive. If I click Continue, the message persists until I hit Continue multiple times.

Anyone know what is going on here? How do I prevent this message from happening?

Thanks!

Bruce


Does his PC have a D, E, or F drive on it?

Also if any of those are CD drives, if they are empty they will come back as not found.
m
0
l
a b $ Windows 7
November 28, 2012 3:43:50 PM

bkorn said:
I have a super simple bat file that pretty much looks like this:

if exist d:\*.* echo D is available
if exist e:\*.* echo E is available
if exist f:\*.* echo F is available

....



It's the "pretty much" part that's probably causing the problem. Post the entire script.
m
0
l
Related resources
a b $ Windows 7
November 28, 2012 3:47:35 PM

yarmock said:
Does his PC have a D, E, or F drive on it?

Also if any of those are CD drives, if they are empty they will come back as not found.



Ran the above script on a system with only a D: drive (CD/DVD, no disc inserted). No output (as expected) and no errors regarding drives not found.
m
0
l
a b $ Windows 7
November 28, 2012 4:26:44 PM

I would expect an SDCard reader is one of the specified drives.

When I tried the script on a card reader (with no card inserted) it threw an error: "Exception Processing Message ..." "Cancel/TryAgain/Continue" (It was however fine for my empty CD-R drive, it may also matter whether the optical drive has write capabilities, since windows lets you cache writes and insert a disk later).

This behavior is probably specific to the device you are checking at each drive letter.
m
0
l
November 28, 2012 4:58:21 PM

Thank you all for your responses.

Yes..one of the drives IS an SD Card reader.

And Yes, some of the drive letters DO map to CD Drives and whatnot.

For example, if my SD card is inserted, the bat file says E is available, but
if my SD card is removed, the bat file returns nothing about an E drive, which is just what I expect.

All I was trying to do was create a script to tell my father-in-law WHAT drive letters were "available" to him (as they sometimes change)

the real bat file has following line repeated from D to Z

if exist d:\*.* echo D is available

And again..on MY Win7 machine it matters not what the drive is or it's state
(or whether media is inserted or not)

But on my father-in-laws machine I get the aforementioned system error message every time, no matter what.

Oy vey.

I thought their might be some kind of window setting that I could turn off to prevent that message from happening.

Oh well..thank you all regardless!



m
0
l
a b $ Windows 7
November 28, 2012 5:05:57 PM

This will list all drives currently defined on the system: 'fsutil fsinfo drives' (only guaranteed to run in Windows 7)


m
0
l
a b $ Windows 7
November 28, 2012 5:27:30 PM

bkorn said:
Thank you all for your responses.

Yes..one of the drives IS an SD Card reader.

And again..on MY Win7 machine it matters not what the drive is or it's state
(or whether media is inserted or not)

But on my father-in-laws machine I get the aforementioned system error message every time, no matter what.

Oy vey.

I thought their might be some kind of window setting that I could turn off to prevent that message from happening.

Oh well..thank you all regardless!



The issue likely is not windows, but rather the device. It's likely that if you have an SD card reader it responds differently do being poked when it has no media inserted than your father-in-law's. If you don't have an SD card reader, then it maybe that all SD card readers behave that way (mine does).

You can test it by using your card reader on his machine and/or his card reader on your machine.
m
0
l
November 28, 2012 6:11:16 PM

ex_bubblehead said:
This will list all drives currently defined on the system: 'fsutil fsinfo drives' (only guaranteed to run in Windows 7)


Oh thank you! I will give this code a try!
m
0
l
!