Run a script only at shutdown (not log off or restart)

Hi,
Is there any way to run a script only at shutdown?
I mean, only when the computer is really shutting down to off state. This script should not run when doing just a log off or restart.
Any help really appreciated. Thank you!
Cheers!

Hi,
The problem is that the standard scripts can't differentiate between a restart and a complete shutdown.
If there's no separate shutdown/power off script (I'm not aware of any), maybe there's some method to detect within a script what is actually in process.
Cheers!

Similar Messages

  • Firefox seems to run in script only

    when i log on to Firefox seems to run in script only it the same when i load any other web page such as the BBC news
    Internet Explorer runs fine

    Clear the cache and the cookies from sites that cause problems.
    "Clear the Cache":
    *Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.org/kb/Safe+Mode

  • I have just updated my MBP to Maverick OS. I am unable to shutdown or log off. When i press the shutdown button, a black screen appears which goes off on pressing any key. The shutdown or log off dialog does not appear. Your kind help is much appreciated.

    I have just updated my MBP 17 / retina display to Maverick OS. I am unable to shutdown or log off. When i press the shutdown button, a black screen appears which goes off on pressing any key. The shutdown or log off dialog does not appear. Your kind help is much appreciated.

    The button response has changed. 
    Short press : sleep
    Medium press (2-3 sec) : restart, shutdown, sleep dialog
    Long press : force shutdown. (Same as before)

  • Windows terminal sessions not logging off

    Hi All,
    I am new to SDG and hoping someone could shed some light on a issue i'm having with applications running on a windows terminal server.
    When i launch a windows application through SGD, it opens and works fine. When I close this application and session, it seems that the terminal session is still being held. Why does it not log off? Is there a SDG setting?
    Any help would be appreciated.
    Jason

    It looks like a process/application running in the background is keeping the session open.
    Please take a look at the following section from the administration guide:
    http://docs.sun.com/source/820-4907/chapter4.html#Z40000061308259
    Greetz,
    Remold

  • MBP will not shut off or restart after installing lion.

    MBP will not shut off or restart after installing lion. I tried installing the latest update but since it will not restart the update will not work.

    Everything works except it will not shut down or restart so I can't update it.
    I run the Adobe master creative suite collection, Microsoft office and countless other software products without a hitch.
    After I click on update software then download the apple update for lion it says I have to restart the computer to finnish the install.

  • My iphone4 is stuck on a blue screen and will not shut off for restart, I have never dropped or had a problem  before....help

    My iphone4 is stuck on a blue screen and will not shut off or restart, I have never dropped or had a problem  before....help?

    Reset the device by pressing and holding the home and power buttons for 15-20 seconds until the white Apple logo appears.

  • How can I run a step only if TestStand not is terminated?

    I want to run a step I Cleanup only if TestStand not is terminated. Is there a variable I can read who tell this?

    Jan Inge -
    I did not know whar version of TS you are using so I created the sequence using TS 2.0.
    In the example a save the state to the numeric result of a numeric limit step and the step determines that execution is normal if the state is 1, so the step passes, otherwise it fails. The precondition of the next steps use the pass/fail status of the first step. This way you do not need a local variable.
    Scott Richardson (NI)
    Scott Richardson
    National Instruments
    Attachments:
    CleanupStepNotRunDuringTermination.seq ‏30 KB

  • Run time error occured while clicking the Log off

    Hello Experts,
    I have customized masthead file. In the masthead, when i click the log off link, the pop-up window will showing the Runtime error message. Its not working properly. I didnt make any changes in log off method. I traced the error,
    <%if (!isPreview){%>
              if (EPCM.getUAType() == EPCM.MSIE)
                   if(EPCM.getGlobalDirty())
                         // unsaved data on the page, display modified dialog
                        var val = window.showModalDialog('<%=GetLogoffConfirmUnsavedMsgURL(componentRequest)%>', '', '<%=LOGOFF_CONFIRM_MSG_ARGS_IE%>');
                        if (val == 'logoff')
                             disableWorkProtectCheck = true;
                             logoff();
                   else //no unsaved data
                        // data saved, nothing get lost on the page, display normal dialog
                      var val = window.showModalDialog('<%=GetLogoffConfirmMsgURL(componentRequest)%>', '', '<%=LOGOFF_CONFIRM_MSG_ARGS_IE%>');
                      if (val == 'logoff')
                          logoff();
              else
                   if(EPCM.getGlobalDirty())
                      window.open('<%=GetLogoffConfirmUnsavedMsgURL(componentRequest)%>', '<%=LOGOFF_CONFIRM_WINDOW_NAME%>', '<%=LOGOFF_CONFIRM_MSG_ARGS_NS%>');
                   else
                      window.open('<%=GetLogoffConfirmMsgURL(componentRequest)%>', '<%=LOGOFF_CONFIRM_WINDOW_NAME%>', '<%=LOGOFF_CONFIRM_MSG_ARGS_NS%>');
         <%}%>
    In this code having if condition if(EPCM.getGlobalDirty()) is set as true means, then only properly executed and it shows the Log off message. In my part it goes to the else part. Then it shows run time error message.
    I cannt able to find out the solution.Pls help me in this regarding.
    Regards
    Prakash T

    Hi,
    see if running SFC /Scannow helps. This basically restores missing/corrupt system files.
    Click Start/Run and type CMD
    Type SFC /Scannow
    Description of Windows XP and Windows Server 2003 System File Checker (Sfc.exe):
    http://support.microsoft.com/kb/310747/EN-US/
    Please Reward Points if Helpful.
    Kind Regards,
    Vamsi.

  • NWA,UME not logging off

    I am having a problem with my NWA and UME. I logged in as j2ee_admin, now, I am not able to log off. Whenever i use the url http://<host>:<port>/nwa, I directly go to the respective home page as j2ee_admin. I am having WebAS 6.40 sp20. What should i do to rectify this problem? Is this a bug?

    Hi,
    This is not the bug. May be it's in the cache memory which is picking default. Clear the Cache and then close the window and enter the details in the new window to get to the required page.
    regards and reward if helpful

  • Itouch has frozen mid-update and will not shut off or restart

    My 5th generation iTouch has recently begun downloading the newest iOS update.  The update did not complete (thus a restart has yet to occur); however, I am unable to even power off the device (held the power button in excess of one minute without it shutting off the device).  I just downloaded the ITunes 12 update, but have some tasks to complete before restarting my computer (to allow for a possible recovery restart).  Also, when plugging in the iTouch to the computer, the device isn't recognized or accessible.
    How can I restart the device without using a recovery option?
    Thank you in advance for your much appreciated attention and  support provided by the community.  

    - Try letting the battery fully drain and then charge and try a reset
    Nothing will be lost      
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Next try connecting to iTunes and try making a backup.
    - Last restore the iPod using Recovery mode if necessary.

  • Script error "object required" when log off

    I have created a new user and assigned the "Everyone" role to it. I log in to the portal using this new user. Then I press logoff. Then I press OK. Now I get the script error below:
    line:91
    char:8
    Error: Object required
    code:0
    URL: http://.....
    any idea why I get this error?
    note: I don't get a logoff error when I use the administrator or other user IDs.

    Hi,
    you are using a customized masthead. InSP14 SAP changed some Javascript and therefor, the "object" your are colling in your logoff() function is missing. You'll have to comment out this JS call in your masthead. Check the IE error message explanation, it will show you the line where the error occurs.
    I've already posted the solution in this forum, but unfortunately, I'm not able to find my previous post
    br,
    Tobias

  • OS X 10.4.3 running on iMAC G5 sometimes does not switch off

    My i Mac G5 has been working nicely and smoothly and still does.. but recently it seems it does not won't to switch off....so I am forced to force it out.
    At times a window appear saying more or less " the mirror agent is unable to log out due to elapsed time "
    Any clues ? thanks - Massimo
    Imac G5-1.6 ghz   Mac OS X (10.4.3)  
    Imac G5-1.6 ghz   Mac OS X (10.4.3)  
    Imac G5-1.6 ghz   Mac OS X (10.4.3)  

    Welcome to Apple Discussions!
    Force shutting down like that isn't wise. Eventually the directory may get damaged. If you had a force shut down for another reason that may have started the loop of having trouble. Backup your data, and follow these instructions for repair of the directory:
    http://docs.info.apple.com/article.html?artnum=106214
    If they don't work, you will want to get Alsoft Disk Warrior.

  • My MacBook will not log off and will not switch back on

    I tried to log out this morning and all I got was the blue screen. I cannot switch on again, what should I do

    Have you turned it off?  Hold the power button fo 10+ seconds and it should turn off.  Try to start it then.  If no success, post back.
    Ciao.

  • HT1430 MY I phone 5 charge was running low.  I plugged it in to recharge - and it did however - all that is appearing on the screen in the top lin shown the time and the battery icon.  The phone will not shut off or restart when I push the button.  What s

    I did that and the phone is not respoinding.

    Hi carolyn8848,
    Thanks for using Apple Support Communities.  This article has steps to take if your iPhone has become unresponsive:
    iOS: Not responding or does not turn on
    http://support.apple.com/kb/TS3281
    Cheers,
    - Ari

  • TS1538 the issue with my phone is that it will not turn off, or restart, and do anything

    When the article was talking about restarting your phone/ipad/ipod touch, i can't because it only has a glowing apple with an empty loading bar and won' do anything else

    Press the Home menu button and the power button until you see the apple sign. Then put it back on.

Maybe you are looking for