Shutdown batch file: endless command repetitions

Hello again!

Wow, that was an awesome analysis. I don't understand all of it yet, but I do get that the shutdown.bat on my desktop was being targeted by other bats with the shutdown command in them (that explains seeing the /s flag in every readout). I didn't think this was an issue, because I also had tried running Re_start.bat as an administrator, which I thought sets the working directory to system32. But indeed, changing the name of shutdown.bat immediately solved the problem (without rewriting all the bats).

As for the rest, it seems like deep waters to me, but I'll try to parse it later, and I'll get back if a light turns on. Thanks very much for some very astute troubleshooting!

Paul

"I also had tried running Re_start.bat as an administrator, which I thought sets the working directory to system32."

Running a Command Prompt as an Administrator does, but running a batch file as either an Administrator or not sets the working dir to the location of the batch file itself.

"but I do get that the shutdown.bat on my desktop was being targeted by other bats with the shutdown command in them"

In actual fact, in most cases, the desktop copy was targeting itself, and the other ones were targeting different other ones.

I haven't made things clearer with that last sentence, have I!?

But I do also believe that we are making progress!

Richard
 

My Computer

System One

  • Manufacturer/Model
    Dell XPS 420
    CPU
    Intel Core 2 Quad Q9300 2.50GHz
    Motherboard
    Stock Dell 0TP406
    Memory
    4 gb (DDR2 800) 400MHz
    Graphics Card(s)
    ATI Radeon HD 3870 (512 MBytes)
    Sound Card
    Onboard
    Monitor(s) Displays
    1 x Dell 2007FP and 1 x (old) Sonic flat screen
    Screen Resolution
    1600 x 1200 and 1280 x 1204
    Hard Drives
    1 x 640Gb (SATA 300)
    Western Digital: WDC WD6400AAKS-75A7B0

    1 x 1Tb (SATA 600)
    Western Digital: Caviar Black, SATA 6GB/S, 64Mb cache, 8ms
    Western Digital: WDC WD1002FAEX-00Z3A0 ATA Device
    PSU
    Stock PSU - 375W
    Case
    Dell XPS 420
    Cooling
    Stock Fan
    Keyboard
    Dell Bluetooth
    Mouse
    Advent Optical ADE-WG01 (colour change light up)
    Internet Speed
    120 kb/s
    Other Info
    ASUS USB 3.0 5Gbps/SATA 6Gbps - PCI-Express Combo Controller Card (U3S6)
Ok, I think I see it now. Every time a desktop bat called for "shutdown", Vista saw it as a recursive call for my shutdown.bat. And that meant that shutdown.bat also pointed to itself - thus, the scrolling. As soon as I tried the bats in other folders, which didn't have a shutdown.bat parked in them, the problem disappeared.

I still don't understand the comment about needing to rewrite all the bats, though (if I understood that correctly). Simply renaming shutdown.bat seems to have solved all my problems.

And thanks for pointing out my error confusing batch files with the command window, with regard to the working directory of an elevated prompt.

Both of you, Tom and Rich, have spent a lot of time with my problem, and I'm very appreciative. I can also say that my delightful new Vista machine (it was a gift), seems a little happier.

Blessings,
Paul
 

My Computer

System One

  • Manufacturer/Model
    dell precision
    Memory
    2G ddr2
    Graphics Card(s)
    matrox
Back
Top