1.

Solve : A minor tweak to a loop.?

Answer»

I could use a little help. For reasons that my peers KNOW, I need to get the shutdown -a COMMAND to repeat infinitely. I can get it to happen, but the command prompt window remains open. Is there any way that I can get it to run and have the window not appear?

Is this possible at all?

What are those "reasons that your peers know"? May we be permitted to know them too? Once we do, we can make an informed decision on what to tell you. Being secretive is not the best way to persuade people to help you.

Sorry. They were watching at the time I initially wrote that. There have been 'random' shutdowns. This is mostly because the local computers aren't that secure from internal sources. Anyways, it seems that at the most inopportune moment, we get a shutdown thrown at us. My response to this was a shutdown -a batch. The issue, though, is that it leaves the window open. I can supply codes if you need.Are you trying to bypass shutdowns initiated by your network admins?No. I work for a small company where we are 'all responsible for our computers'. That's boss language for 'there aren't enough of you to make it worth hiring a dedicated sysadmin.'

Anyways, my coworkers keep initiating shutdowns. I have the following running:

Code: [Select]@echo off
:start
shutdown -a
goto start
Unfortunately, this keeps the window open. What I want to know is if there's a way of essentially running the same file, but without it being in an open window.Surely your colleagues would be wise to attend to their work instead of misusing their employer's IT equipment to play silly pranks on their co-workers? Where I work, people have been (rightly) fired for such things. Maybe a WORD with that boss of yours would be a more practical way of stopping people trying to shut down your PC if that is what you mean. Surely that is very irresponsible BEHAVIOUR? You might have work in progress that would be lost. Your boss might be interested to know how people are using the time that he pays for, and also following on from that, very interested to know how he could get the same amount of work (or more!) done for less money by employing only responsible people!

I was cautious before because we get a lot of queries on here from people who are, - how SHALL I put this? - quite young, and they seem to want to know how to play tricks on their fellow workers or students such as ejecting their CD trays, shutting down their PCs, spamming them with network messages, or help to avoid site blocks, etc, etc.

Without addon software, there is no built in way to run a batch file in "hidden" mode. You can use the start command with the /MIN switch to run a batch file minimized to the taskbar.
Thanks to llmeyer1000 for making the point that I can just compile it into an exe.

I can't believe I didn't think of that.



Discussion

No Comment Found