tags:

views:

239

answers:

5

I've written a powershell script that I've turned into a scheduled task. So far, so good. The issue I have is that every time Powershell is started, it causes my floppy drive to seek; this means every five minutes (on the task schedule), I get a little "grind" from the floppy drive.

How do I disable this behavior?

    C:\fa>powershell -noprofile
    Windows PowerShell
    Copyright (C) 2006 Microsoft Corporation. All rights reserved.

    PS C:\fa> exit

    C:\fa>

When I do this test, I get a seek when I start and when I exit. I assume the error would go away if I had a floppy disk to put in the drive.

As a poor work-around, I disabled the floppy drive in BIOS. I've removed the red herring about the drive not being available; this was because of another issue.

The suggested way to find what, in my profile, points to A:, turned up nothing.

PS C:\fa2> dir Env:\ | ?{$_.Value -like "A:\*"}
PS C:\fa2>

this was, of course, after I re-enabled the floppy drive in BIOS.

A: 

It could be something in your profile script(s). I've not experienced PowerShell causing any floppy drive activity...
If you start PowerShell.exe with the -noprofile option, it will not run the profile scripts (so long as your script does not depend on anything from your profile).

Steven Murawski
This does not change the behavior.
Ry
A: 

I think it may be a permissions problem. Can you access the drive outside of PowerShell?

I found a couple references to this problem here and here.

aphoria
I can; it doesn't look like a permissions issue.
Ry
You said you disabled the floppy in the BIOS. Do you still see the error in PowerShell? It might not have permissions to a different drive. Do you have any network drives mapped?
aphoria
This was a different issue; I've edited the OP to reflect that issue being a red herring.
Ry
A: 

Check to make sure nothing in your Environment is pointing to the drive.

 dir Env:\ | ?{$_.Value -like "A:\*"}
slipsec
Assuming of course that it's the "a" drive :)
slipsec
A: 

Stop using floppy disks?

/ducks

Coderer
Maybe I should post a question under "meta": "Why doesn't SO have a sense of humor?"
Coderer
what makes you think it does not ? I found that amusing :D
Bahbar
+1  A: 

I'd say its the drive enumeration that happens at runtime. Powershell builds a list of drives and creates aliases for each one so you can type "A:" and have it work like cmd.exe. I think this because if you start Powershell on a clustered server, that does not own a shared drive (is owned by the other node), it issues an error saying that the drive is not accessible. Yet, everything is normal in the shell.

That being said I've never seen this behaviour (floppy drive seek on load) on any of the hundreds of machines I administer.

James Pogran