Hello Guest it is October 23, 2019, 10:39:01 PM

Author Topic: PC shutdown  (Read 1962 times)

0 Members and 1 Guest are viewing this topic.

PC shutdown
« on: March 31, 2017, 10:20:59 AM »
Hi!
I am trying to make a VB script that shutdowns Mach3 and the PC. Reading in some pages, I came across two possibilities:
1.- Shutting down using OEMButton 705.
2.- Shutting down using shell("shutdown.exe -s -t")

Both of them work, they close all the active programs at the moment and begin shutting down the PC. The problem is that it stays in the shutting down window and takes a lot of time for it to shutdown. Both possibilities. I even get desperate and push the reset button on my PC.

Any idea why this is happening? Or any other idea how to do this?

I thnak you all for your answer.

C├ęsar

Offline CES

*
  •  62 62
    • View Profile
Re: PC shutdown
« Reply #1 on: May 21, 2017, 04:57:11 PM »
Hi Cesar,
  Try    "shutdown /l /s / 0"
That's lowercase "L", "S" and a number zero.

/l means log off, /s is shutdown, and /t is set time to shutdown.

Charles