Shutdown from a logoff script

I have created a GPO that calls a  logoff script.  This script looks for other batchfiles and executes them.  I am using this method install an applications and then reboot.  However, when the batch file runs
shutdown -r  -f -t 0, I get device not ready.  I there any way to either force a reboot from a logoff script? Or a way to abort the logoff when I am installing the app then force a reboot then? 

What about using this only : shutdown -r  -f ?
Does it works?
Arnav Sharma | Facebook |
Twitter Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members
reading the thread.

Similar Messages

  • Scripting question: Is there a difference between shutdown from within the VM and using the WMIService InitiateShutdown

    Hi,
    Are there any problems with shutting down a virtual machine using a script?  (example of shutdown script here). 
    In this case, I want to start VM's in a particular sequence and timing, and then reverse the sequence and timing for shutdown.  The built-in settings of hyper-V haven't been adequate.
    Is the command "ShutdownList.ItemIndex(0).InitiateShutdown(True,"script
    shutdown")" the same thing as initiating a GUI activated shutdown process?
    If not, does commanding a shutdown from the host using a script cause
    any system problems inside the VM?  If so, are there other or better ways to accomplish this?
    Thanks.
    Best Regards,
    Alan

    Hi Alan,
    I would like to check if you need further assistance .
    Best Regards
    Elton Ji
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • IMac will only restart or shutdown from power button.

    My iMac will only restart or shutdown from the power button, it also will not logoff users. It starts ok, but only after a hard reboot?? I have repaired permisions and no change. I have a clone I can restore from but any ideas whats up here?
    The only things that I know I have altered are deleting files saved during migration from Panther (months ago)and running Unbuntu Live CD.
    iMac G4 15 Mac OS X (10.4.7) 728ram

    Are you booting into Ubuntu Linux? Most of us here wouldn't now anything to do with it. If the problem is occurring when booted into Mac OS X, it may be a sign of data corruption in the power management and user settings. Some corruption is easy to repair such as fixing the directory (which I'd only do after a clone). Here's how according to my FAQ:
    http://www.macmaps.com/directoryfaq.html
    And I assume the issue is with your iMac G4.

  • How to create and add a logon/logoff script to populate last user into the computer field in AD

    Hi All,
    Bit stuck here,
    Not sure what forum to put this is as it involves different subjects,
    I work in a Server 2008 RT environment and have access to Active Directory etc.
    I saw this a few weeks ago - http://ivan.dretvic.com/2012/10/automatically-generate-description-field-for-computers-in-active-directory/
    Now, I'm not particularly sure what to do here, I don't know how to create a group policy etc. How to implement it in a test environment etc. Never done this before.
    Can somebody give me a step by step guide on literally everything that would be involved in this?
    Or any links that may be able to help?
    I basically want the AD to show who was the last user that logged into a specific client when the client named is searched for in the Computers OU, and if possible being able to pull the make/model and serial number from the client aswell.
    If possible there should be a way of including this with the existing login script that we already have, how can I do this?
    I've tried a few so far and got stuck, I have domain admin priveledges also.
    Thanks,
    Regards, Max.

    Hi Max,
    Please refer to the following article to learn how to create a logon/logoff script via GPO:
    Assign User Logon Scripts
    Assign User Logoff Scripts
    As for the issues about script, this is the forum to discuss questions about driectory service, better to post your question to the forum for Script:
    http://social.msdn.microsoft.com/Forums/en-US/home?forum=scripting
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or
    learn from your interaction with us.
    Thank you for your understanding.
    Regards,
    Lany Zhang

  • How do I shutdown from within Genome??

    How do I shutdown from within Genome??
    There is only a logout option - and that do not work.
    If I open a terminal and enter init 5 nothing happens.
    Or so it seems some services maybe stop.
    BUT there is no logoff and shutdown of Genome. So I swicth
    off my pc and next time I boot up my file system was corrupted.
    FSCK did not work I end up install everything this time use bypass
    option and install the patches for PC-Solaris 8.
    How do I go to a command line environment within Genome
    a .dtconfig stop ?? Will this let Genome come down without
    booting up and loosing my system again??

    ok... i figured it out... a 'Sprite' is really also a DisplayObjectContainer... so if i make my class an extension of Sprite i can 'addChild' to the Sprite and then add them all to the stage at once by adding Sprite to the stage...

  • Logoff script is not completing on computers in remote locations

    Hi folks,
    We're running a logoff script on our Win7 Enterprise SP1 machines that invokes three robocopy statements which copy various local directories to our Netapp as a backup. The logoff script is called through GP at 'User Configuration|Policies|Windows Settings|Scripts
    (Logon/Logoff)'.
    If the machine is in the corporate office, there is no trouble, the script completes, and all files are copied. If the machine is located at our branch office (connected across the WAN via an IPSEC tunnel), or by Directaccess, the third robocopy statement
    will not complete, and the logoff script just exits as the user is logged off. The robocopy log is truncated in the middle of the copy. This script can be run interactively and it will complete without difficulty. It would seem that the copy is taking
    too long to complete?
    In researching this, I found that the default time allowed  for a logon/logoff/startup/shutdown script to complete is 10 minutes, and that this can be changed through GP at 'Computer Configuration|Policies|Administrative Templates|System|Scripts|Maximum
    wait time for group policy scripts'. The trouble is that even in remote locations, the script fails way before that default 10 minute timeout. In fact, the script runs slightly less than a minute before the logoff occurs. I tried setting the max wait time
    to 0 (infinite time), but that did not help.
    I've also tried breaking the three robocopy commands out into separate batch files and invoking each with a 'call' statement, and adding 'start /wait' in front of each command, but neither of those worked either.
    Does anyone have a clue why the logoff script is exiting so quickly? Thanks for any help,
    ianc

    Do your robocopy statements log to a file?  It may be worth while to tweak your batch scripts a bit to generate a log.
    @echo off
    echo. & echo Backing up Data Set 1 - Please Wait ...
    @echo %date% %time% - Starting Robocopy 1 of 3 >> C:\Logoff.log
    robocopy /s /w /i /t /c /h /e /s source1 destination1 /log+:C:\Logoff.log
    @echo %date% %time% - Finished Robocopy 1 of 3 >> C:\Logoff.log
    echo. & echo Backing up Data Set 2 - Please Wait ...
    @echo %date% %time% - Starting Robocopy 2 of 3 >> C:\Logoff.log
    robocopy /s /w /i /t /c /h /e /s source2 destination2 /log+:C:\Logoff.log
    @echo %date% %time% - Finished Robocopy 2 of 3 >> C:\Logoff.log
    echo. & echo Backing up Data Set 3- Please Wait ...
    @echo %date% %time% - Starting Robocopy 3 of 3 >> C:\Logoff.log
    robocopy /s /w /i /t /c /h /e /s source3 destination3 /log+:C:\Logoff.log
    @echo %date% %time% - Finished Robocopy 3 of 3 >> C:\Logoff.log
    echo. & echo Finished Backing Up Data!
    @echo %date% %time% - Exiting Script >> C:\Logoff.log
    exit /b
    Depending on the results of that, you may want to consider maybe creating a different script to perform some tests to validate network connectivity.  The example below is a bit over the top but we ended updoing something similar to what's below for
    testing remote connections, especially when users had intermittent connectivity problems.  (Hence the goto top)
    @echo off
    set ExternalHosts=www.yahoo.com www.google.com www.msn.com www.aporter.com %gateway%
    set InternalHosts=someserverhostname1 some.server.IP.Address1 someserverhostname2 some.server.IP.Address2
    set logfile=C:\ExternalNetworkTest-PathPing.txt
    if exist "C:\windows\system32\pathping.exe" (
    set ptcmd=pathping -n %%i
    set trace=0
    ) else (
    echo %date% %time% Pathping does not exist on this machine - relying on ping and trace >> %logfile%
    set ptcmd=ping -n 10 %%i
    set trace=1
    echo ********************************************* >> %logfile%
    date /t >> %logfile%
    echo ********************************************* >> %logfile%
    echo. >> %logfile%
    :TOP
    for %%i in (%ExternalHosts%) do (
    CALL :CURDT %logfile%
    echo ********************************************* >> %logfile%
    %ptcmd% >> %logfile%
    if /i %trace%==1 CALL: TRACE %%i
    CALL :GETIPINFO %logfile%
    for %%i in (%InternalHosts%) do (
    CALL :CURDT %logfile%
    echo ********************************************* >> %logfile%
    %ptcmd% >> %logfile%
    if /i %trace%==1 CALL: TRACE %%i
    CALL :GETIPINFO %logfile%
    rem CALL :GETIPINFO %logfile%
    echo. >> %logfile%
    rem you could have it loop but for this test
    rem that is not necessary for you
    rem GOTO TOP
    rem goto end
    :CURDT
    set hh=
    set hhmmss=
    set hh=%time:~0,2%
    if "%time:~0,1%"==" " set hh=0%hh:~1,1%
    set hhmmss=%hh%:%time:~3,2%:%time:~6,2%
    echo %hhmmss% >> %1
    GOTO :EOF
    :TRACE
    set tracecmd=tracert -d %1
    CALL :CURDT %logfile%
    echo ********************************************* >> %logfile%
    %tracecmd% >> %logfile%
    GOTO :EOF
    :GETIPINFO
    ipconfig /allcompartments /all >> %1
    rem Get IP Adddress
    for /f "usebackq tokens=15" %%a in (`ipconfig ^| find /i "IP Address"`) do set ip=%%a
    rem echo %date% %time% IP Address is %ip% >> %logfile%
    rem echo %date% %time% IP Address is %ip% >> %1
    rem Get Gateway
    for /F "usebackq tokens=13" %%i in (`ipconfig ^| find /i "gateway"`) do set gateway=%%i
    rem echo %date% %time% Gateway is %gateway% >> %logfile%
    rem echo %date% %time% Gateway is %gateway% >> %1
    GOTO :EOF
    :END
    echo %date% %time% exiting script >> %logfile%
    exit /b

  • How to Reset dbid from a Shell Script

    I would like to use a shell script to:
    1) Automate the restore of our Produciton backups to a different server
    2) Reset the dbid prior to exiting the script
    Is there a way to reset the dbid from a shell script?
    When I use the following, it has an interactive prompt in the middle of it, and I don't see anything in the syntax diagram found in the "Oracle Database Utilities" manual that will let me get around this.
    nid target =/
    DBNEWID: Release 10.2.0.3.0 - Production on Fri Aug 8 09:37:04 2008
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Connected to database DRTEST (DBID=3725550444)
    Connected to server version 10.2.0
    Control Files in database:
    /s01/oradata/drtest/control01.ctl
    /s01/oradata/drtest/control02.ctl
    /u01/oradata/drtest/control03.ctl
    Change database ID of database DRTEST? (Y/[N]) => y
    Proceeding with operation
    Changing database ID from 3725550444 to 3752603328
    Control File /s01/oradata/drtest/control01.ctl - modified
    Control File /s01/oradata/drtest/control02.ctl - modified
    Control File /u01/oradata/drtest/control03.ctl - modified
    Datafile /s01/oradata/drtest/system01.dbf - dbid changed
    Datafile /s01/oradata/drtest/undotbs01.dbf - dbid changed
    Datafile /s01/oradata/drtest/sysaux01.dbf - dbid changed
    Datafile /s01/oradata/drtest/users01.dbf - dbid changed
    Datafile /s01/oradata/drtest/rman.dbf - dbid changed
    Datafile /s01/oradata/drtest/temp01.dbf - dbid changed
    Control File /s01/oradata/drtest/control01.ctl - dbid changed
    Control File /s01/oradata/drtest/control02.ctl - dbid changed
    Control File /u01/oradata/drtest/control03.ctl - dbid changed
    Instance shut down
    Database ID for database DRTEST changed to 3752603328.
    All previous backups and archived redo logs for this database are unusable.
    Database has been shutdown, open database with RESETLOGS option.
    Succesfully changed database ID.
    DBNEWID - Completed succesfully.

    ... When I use the following, it has an interactive
    prompt in the middle of it, ...You may want to try out "Expect" for automating any interactive script.
    isotope

  • Logoff Script Take 2-3 min

    Hi All,
      I have create user logoff script to uninstall software. Now i have two issues.
     1. Take long to logoff
     2. How do i allow only once? 
    $ArgumentsStandard =" /quiet "
    $ArgumentsStandard +="/norestart"
    $App = Get-Content "\\server\share\un-installApp.txt"
    #gwmi gets the list of applications
    # where selects just the apps im interested in removing
    # start-process removes each app using msiexec with quiet and norestart options
    Write-Host "start un-installing software from list"
    gwmi win32_product |
    where { $App -contains $_.Name } |
    ForEach-Object {
    Write-Host "start un-installing $_.name"
    $Arguments = "/uninstall "
    $Arguments += $_.IdentifyingNumber
    $arguments += $ArgumentsStandard
    Start-Process "MSIExec" -ArgumentList $Arguments -wait

    Hi Martin,
      I don't know how to do this in PowerShell So can you help me with the if  code? 
    if exist "c:\cid3.txt" goto end
    $ArgumentsStandard =" /quiet "
    $ArgumentsStandard +="/norestart"
    $App = Get-Content "\\server\Softwareshare\un-installApp.txt"
    #gwmi gets the list of applications 
    # where selects just the apps im interested in removing 
    # start-process removes each app using msiexec with quiet and norestart options 
    Write-Host "start un-installing software from list"
    gwmi win32_product | 
    where { $App -contains $_.Name } |
    ForEach-Object {
    Write-Host "start un-installing $_.name"
    $Arguments =  "/uninstall "
    $Arguments += $_.IdentifyingNumber
    $arguments += $ArgumentsStandard 
    Start-Process "MSIExec" -ArgumentList $Arguments -wait
    New-Item c:\cid3.txt -type file
    :end

  • Logoff script terminated prematurely on windows 7

    I have a logoff script that backup the user profile, it works fine on all but one computer, it seems that the script is just killed but I can't figure out why
    I already changed MaxGPOScriptWait to 0 and gpssvc PreshutdownTimeout to ffffffff and I also see winlogon warnings 6005, 6006, user profile service 1530 and user32 1073

    Hi,   
    We can use the gpresult /h GPReport.html command to generate a Resultant Set of Policy (RSoP) report. We could check if the policy setting gets applied successfully from the report. Besides, can you run the
    script manually on the computer?
    In addition, for this just occurs to one computer, we can try to use clean boot to re-boot the computer and check if the logoff script can run successfully.
    For detailed information about how to perform a clean boot in Windows, we can refer to the following link:
    How to perform a clean boot in Windows
    http://support.microsoft.com/kb/929135
    Best Regards,
    Erin

  • Is it possible to call a method in a servlet from  a java script ?

    I need to do a dynamic html page . In the page i select some things and then these things must communicate whit a servlet because the servlet will do some DB querys and update the same webpage.
    So is it possible to actually call a method of a servlet from a java script? i want to do something that looks like this page:
    http://www.hebdo.net/v5/search/search.asp?rubno=4000&cregion=1011&sid=69DHOTQ30307151
    So when u select something in the first list the secodn list automaticly updates.
    thank you very much

    You can
    1. load all the options when loading the page and
    set second selection options when user selected
    the first; or
    2. reload the page when user select first selection
    by 'onChange' event; or
    3. using iframe so you only need to reload part of
    the page.

  • Calling a report from unix shell script

    Hi,
    I had to call a report from unix shell script.
    May i know the procedure to accomplish this
    Thanks in Advance
    A.Gopal

    First you should not include the whole path to your report in the call ...
    Use like this:
    /ora/u01/oracle/v101/as2/bin/rwrun.sh report=an_stati destype=file desname=/ora/u01/oracle/v101/as2/test.pdf desformat=pdf
    In $ORACLE_HOME/bin/reports.sh:
    1) Verify that you have updated the REPORTS_PATH variable to include your folder where you have the report in question
    REPORTS_PATH=/ora/u20/app/qits/env1/run:$ORACLE_HOME/reports/templates:$ORACLE_HOME/reports/samples/demo: ....
    2) Verify that the REPORTS_TMP variable is pointing to a valid location and that the oracle user has access to write on it.
    After that, post the content of the tracefile located at $ORACLE_HOME/reports/logs/{in-process report server name folder}/rwserver.trc
    If no file is present then it means that you need to enable trace in your reports's conf file.... go to the $ORACLE_HOME/reports/conf folder and and locate the .conf file that correspond to your in-process reports server name (as specified in the rwservelet.properties file)... open/edit the file to enable trace logs ..
    i.e.
    Change the following line:
    <!--trace traceOpts="trace_all"/-->
    to <trace traceOpts="trace_all"/>
    Bounce the reports server and try to run the report again, this time the .trc file should be generated, post the content so that we can take a look.

  • How to call a perl script from an apple script

    Hi All,
    How to Call a perl Script from an apple script.
    Pls Give Your comments.
    Thanx & Regards,
    Esther

    Applescript to call a perl script named "/tmp/x.pl" passing an argument "world"
    do shell script "/usr/bin/perl /tmp/x.pl world"
    or if the script is given the executable atttribute (chmod +x /tmp/x.pl),
    do shell script "/tmp/x.pl world"
    Perl script "/tmp/x.pl" that prints a string using a passed argument
    #!/usr/bin/perl
    print "Hello $ARGV[$1]\n";

  • Getting the output from a Perl script using Runtime.exec

    I cannot get the output from a perl script using Java. Can someone PLEASE help?
    I used the following code:
    Process p = Runtime.getRuntime().exec("C:\\Perl\\bin\\Perl.exe script.pl) ;
    InputSream in = p.getInputStream();
    b...
    do
    System.out.println(b);
    while ((b = in.read()) > 0)
    But there is no way that I get the output in the inputstream. If I use the command "cmd script.pl", the output is displayed in the Dos box, but also not in the inputstream.
    I will appreciate any help.

    Try this
    Process p = Runtime.getRuntime().exec("C:\\Perl\\bin\\Perl.exe script.pl) ;
    BufferedReader rd = new BufferedReader(new InputStreamReader(p.getInputStream()));
    String str;
    while((str=rd.readLine())!=null){
    System.out.println(str);
    Manu

  • Error when calling a stored procedure from a SQL Script

    Apologies if this is a really dumb question but I can't seem to call a procedure in package from a SQL script. I have a simple package.procedure containing a loop to populate a table. I would like to include a call to this procedure from my database install script, that also includes my CREATE and INSERT statements. I run the script using "@install_databae" and the CREATE and INSERT statements run fine. The script gives an error when it reaches the line below:
    exec lazarus.PopulateGridPositions;
    and gives the error.....
    BEGIN lazarus.PopulateGridPositions; END;
    ERROR at line 1:
    ORA-04063: package body "LAZARUS.LAZARUS" has errors
    ORA-06508: PL/SQL: could not find program unit being called: "LAZARUS.LAZARUS"
    ORA-06512: at line 1
    The procedure and package have both compiled without errors and the statement on its own works fine in SQL*Plus.
    I've obviously missed some fundamental concept with scripts and SQL. Please can anybody help me?

    Histon FTM wrote:
    ORA-04063: package body "LAZARUS.LAZARUS" has errors Above, obviously conflicts with the statement that follows:
    >
    The procedure and package have both compiled without errors and the statement on its own works fine in SQL*Plus.I suggest you take a look in the USER_ERRORS view to see, what the errors are.
    And just checking:
    You have schema called LAZARUS, which holds a package named LAZARUS, which holds a procedure called POPULATEGRIDPOSITIONS?
    Edited by: Toon Koppelaars on Oct 1, 2009 5:55 PM

  • Filling Activity fields from the Interactive Script WinClient

    Hi Experts,
    I am working with Interactive Scripting (CRMM_TM_SCRIPT) and I already defined my interactive script. I am also creating Activities after I finish with the Script in order to register a case. I am doing this by defining an Action Type CIC-AB which calls an Action Box in the Interaction Center WinClient. In the Action field I define the name of the Activity I want to call from the Action Box of the Interaction Center.
    When the Agent receives a call, he navigates in the Interactive Script in order to clasify the case he is treating. At the end of the Script, the case needs to be register following the clasification made by the Agent, and that’s why we are calling an Activity. The thing is that we don’t want the Agent to fill again the information he just defined in the Script in the Activiy, so we want to fill certain fields of the Activiy I am calling with Information of the Interactive Script I used before, in order to save time to the Agent that Register the Case.
    Can anyome shed some light on this issue?
    Thanks to everyone.

    Alberto
    You can create an activity.i.e., you can create an Order from the Interactive Script if you already created the Script structurethen follow the below steps
    I think it would be helpful
    Procedure: 
    T-Code:  EWFC0
    Path: SPRO&#61664;IMG&#61664;Customer Relationship Management&#61664;Customer Interaction Center&#61664;Visible Components&#61664;Action Box Settings&#61664;Define Configuration Profile for Action Box.
    1. Choose F4 help to select one of the Action Box profiles you have created and you want to adapt and choose change.
    2. Mark the Action box Configuration and create a new Action Box Group by choosing Create transaction group.
    Enter a group ID, description and icon for the new transaction group and choose Continue.
    3. Mark the new transaction group and create a new Action Box transaction by choosing Create transaction.
    4. Enter a transaction ID.
    5. Enter a Transaction Definition section, select Workspace.
    6. In the Transaction Definition section, select Workspace.
    Two additional fields will appear.
    7 Choose F4 in the Workspace field to select the Script.
    8. Choose F4 in the profile field to select the Interactive Scripting profile that you created in the previous steps above.
    9. Enter a Slot Name if desired.
    10. Choose Continue.
    You are automatically taken to the Maintain Data Flow screen .No data flow parameters need to be maintained for the Interactive Scripting workspace.
    11. Choose Back.
    12 Choose Save.
    Note:  Since Only Workspace of this type can be open at once, you will need to close the Automatically Created Interactive Scripting Workspace before launching the Interactive Scripting Action Box call.
    Regards
    Surendra

Maybe you are looking for

  • 9i AS installation problem on NT

    Please help. I try to install 9iAS with HTTP Server only option on my NT workstation, on which Oracle 8.0.4 Server are running. So I choose another HOME for iSuites (DEFAULT_HOME = c:\ORANT for existing oracle server, iSuites_Home = d:\iSuites for 9i

  • Unable to set login items in System Preferences

    Hi! I have a mobile account maintained by mac os x server 10.4.10. I upgraded clients to leopard. When I want to display the login items pane from System Preferences I get the following log entry: 01.11.07 18:18:19 System Preferences[1315] * Assertio

  • Where are classes for oracle.xml.parser.v2?

    I have downloaded both V1 and V2 of the XML parser. I have managed to download the java classes under org.w3c.dom from www.w3.org but I can't find the classes under oracle.xml.parser.v2 (or without v2) anyway on technet. Both are required for import.

  • Office control in mobile client 7.1

    Hi all, i've included an office control in my mobile application to show a word document. However, when i open my application, i receive following error: Fatal HTTP error 500 occured. Connection is closed now. The exact error information is logged in

  • Error when configuring Desktop Software with Outlook 2007 Calendar

     Hello, I am trying to find some help for a problem I'm having with a Blackberry 8100. I would like to use the Desktop Software 5.0 in conjunction with Outlook 2007 (on Windows 7 64 bits) to sync the calendar between the device and the computer. Actu