Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Shutdown abort batch script fails to run at shutdown/logoff or too slow

$
0
0

EDIT:

I have made some progress since what I wrote earlier!

I have succeeded in running the script while shutting down and logging out and also been able to make the script visible by changing some settings from gpedit, but now the problem seems to be aborting the shutdown.

The script will pause the shutdown, but cannot abort it since the shutdown isnt really going on while the script is still being run, so I get error from shutdown.exe 

Unable to abort the system shutdown because no shutdown was in progress.(1116)

or atleast I think that's how it's in english as I haven't changed the language to english and my OS is running in Finnish language.

And after I press some key to continue batch pause the system will continue to shutdown or logout.

There must be some way to return to use the OS or abort the upcoming shutdown.

Any ideas?

Hello.

I have a shutdown abort batch that I have installed in gpedit.msc but it seems to not be working at shutdown/logoff.

However it works at login(the other part of the batch, not the shutdown abort ofc), but it loads very slowly.. 

Also the batch runs as ghost application, it doesnt open the cmd, but it makes beep sounds like it should be so thats how I know it loads and works atleast somehow.

Here's what I have:

@echo off

shutdown -a
type beep.txt
type beep.txt
type beep.txt
pause )
)

note that beep.txt contains just ctrl+g so it makes beep sounds in cmd.

Also I would like to add that the script is in 'C:\folder\' dir, not in the actual script folders of windows.. But like I said, 

it loads at logon anyway.

Hopefully someone can enlighten me quickly with this situation as I'm not very talented with these kinds of things!

Thank you!




Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>