1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

Resolved Starting Remote Computer

Discussion in 'Networking (Hardware & Software)' started by neb, 2012/05/10.

  1. 2012/05/10
    neb

    neb Inactive Thread Starter

    Joined:
    2010/03/13
    Messages:
    61
    Likes Received:
    0
    I have made a small script (rstop.cmd) to shutdown a remote computer :
    "shutdown /m \\huttesrv001.hutte.local /s /f" which works fine.
    Now I would like to to shutdown the remote computer when I shutdown my own computer so I put that script in:

    GpEdit.msc
    Computer Configuration
    Windows Settings
    Scripts
    Shutdown

    and there it is: it doesn't work. Other scripts work well within this configuration.

    Also, I have a similar script for starting the remote computer and put it in

    GpEdit.msc
    Computer Configuration
    Windows Settings
    Scripts
    Startup

    which works fine.

    Does anyone know why the shutdown script doesn't work in GPEdit.msc?
    Thanks in advance.
     
    neb,
    #1
  2. 2012/05/10
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    Perhaps the shutdown script is following your own shutdown function and does not get a chance to execute.
     

  3. to hide this advert.

  4. 2012/05/11
    neb

    neb Inactive Thread Starter

    Joined:
    2010/03/13
    Messages:
    61
    Likes Received:
    0
    Yes, I thought in the same direction. This means that there is no solution to the problem?
     
    neb,
    #3
  5. 2012/05/11
    Steve R Jones

    Steve R Jones SuperGeek Staff

    Joined:
    2001/12/30
    Messages:
    12,315
    Likes Received:
    252
    You could run the shutdown script manually with a click or two..and then shut down your machine.
     
  6. 2012/05/11
    neb

    neb Inactive Thread Starter

    Joined:
    2010/03/13
    Messages:
    61
    Likes Received:
    0
    What I have done is writing a script in which I shutdown the remote PC first and then shutdown my ow PC. That works.
    Nevertheless a pity it can't be done through Windows' own shutdown button.
    Thanks for all the help.
     
    neb,
    #5
  7. 2012/05/11
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    What operating system is the remote computer?
    Is the other computer a mapped drive on your system?
     
  8. 2012/05/11
    neb

    neb Inactive Thread Starter

    Joined:
    2010/03/13
    Messages:
    61
    Likes Received:
    0
    The remote computer is an XP SP3; the local computer a Windows7.
    Rights are given on the remote computer and the firewall is set to pass the request (it works when I run the script manually)
     
    neb,
    #7
  9. 2012/05/11
    neb

    neb Inactive Thread Starter

    Joined:
    2010/03/13
    Messages:
    61
    Likes Received:
    0
    the 2 computer are both separate computers.
     
    neb,
    #8
  10. 2012/05/11
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    If it works manually, it should work via gpedit, unless there's a policy on the remote system that disallows it.
     
  11. 2012/05/12
    neb

    neb Inactive Thread Starter

    Joined:
    2010/03/13
    Messages:
    61
    Likes Received:
    0
    yes, I thought so too; problem is I don't know what I can do to get it working; I gave rights on the remote pc (also both login accounts are the same); even shutdown the firewall (normally the port is set to let it pass). For testing I send via Gpedit/shutdown a ping command (| to file) and that works great.
    I think the problem is: my pc is already logged off BEFORE the command is send to the remote PC.
    I think I have to live with that.
     
    neb,
    #10
  12. 2012/05/12
    SpywareDr

    SpywareDr SuperGeek WindowsBBS Team Member

    Joined:
    2005/12/31
    Messages:
    3,752
    Likes Received:
    338
    Did you try some kind of a pause (do nothing loop) at the very end of the script?

    In other words, what I think you're trying to get the local computer to do is to:
    1. send the shutdown command to the remote computer,
    2. then wait say 15 seconds or so ...
    3. before closing the script and attempting to finish shutting itself down.
    ?

    The command:
    ping -n 15 127.0.0.1>nul​
    would cause a 15 second delay.
     
  13. 2012/05/12
    neb

    neb Inactive Thread Starter

    Joined:
    2010/03/13
    Messages:
    61
    Likes Received:
    0
    I tried it, but it doesn't work either.
    too bad.
    I also changed the fqdn with the corresponding ip address with the same result.
    Thanks for the help
     
    neb,
    #12
  14. 2012/05/12
    SpywareDr

    SpywareDr SuperGeek WindowsBBS Team Member

    Joined:
    2005/12/31
    Messages:
    3,752
    Likes Received:
    338
  15. 2012/05/13
    neb

    neb Inactive Thread Starter

    Joined:
    2010/03/13
    Messages:
    61
    Likes Received:
    0
    yes, I did that in the first place. Works like a charm except when I put the batch file in c:\Windows\System32\GroupPolicy\Machine\Scripts\Shutdown and activate it with "Local Group Policy Editor" it doesn't work. (other test batch files such as ping do work)
     
    neb,
    #14
  16. 2012/05/13
    SpywareDr

    SpywareDr SuperGeek WindowsBBS Team Member

    Joined:
    2005/12/31
    Messages:
    3,752
    Likes Received:
    338
    Why put it in c:\Windows\System32\GroupPolicy\Machine\Scripts\Shutdown and activate it with "Local Group Policy Editor "?

    How about simply sticking it in a folder somewhere and creating a shortcut to it on your Desktop (or in your Start menu)? Then, whenever you want to shutdown, click the shortcut to run your batch file.
     
  17. 2012/05/13
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    Try using it as a Logoff script instead of a Shutdown script in GPE, since when shutting down, a user is always first logged off.

    And, unless you map the drive on the other computer, you will first have to logon to it before you can do anything with it. Mapping a drive will auto log you on to it every time you start your computer.
     
  18. 2012/05/13
    neb

    neb Inactive Thread Starter

    Joined:
    2010/03/13
    Messages:
    61
    Likes Received:
    0
    I have considered doing this, but it is no option for me.
    Thanks for the suggestion.
     
    neb,
    #17

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.