AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Shutdown
Goto page 1, 2  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List
View previous topic :: View next topic  
Author Message
beardboy



Joined: 02 Mar 2004
Posts: 444
Location: SLC, Utah

PostPosted: Thu Mar 11, 2004 6:46 am    Post subject: Shutdown Reply with quote

To be able to use the Shutdown command to have the computer go to Suspend / Hibernate mode. Low priority suggestion.

thanks,
beardboy
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Thu Mar 11, 2004 1:50 pm    Post subject: Reply with quote

You might want to try "Send, {Sleep}" with the latest version. I think it's the equivalent of pressing the sleep button on your keyboard or computer (if it has one). You might also be able to change what the Sleep button does (hibernate, suspend, etc.) using an OS setting, which I think I remember seeing somewhere.

I'd be interested to know if this is at all helpful. If it is, I will update the docs to mention it in the Shutdown notes.
Back to top
View user's profile Send private message Send e-mail
beardboy



Joined: 02 Mar 2004
Posts: 444
Location: SLC, Utah

PostPosted: Thu Mar 11, 2004 3:22 pm    Post subject: Reply with quote

The "Send, {Sleep}" does not work on my laptop. I found a website that has multiple excutables for instant suspend / hibernate.

hibernate(forced).exe
hibernate(neverforce).exe
Hibernate(waitthenforce).exe
suspend(forced).exe
suspend(nerverforce).exe
Suspend(waitthenforce).exe

So I just used the FileInstall to include the file in the AutoHotkey executable.

thanks,
beardboy
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Thu Mar 11, 2004 4:28 pm    Post subject: Reply with quote

Even so, I'll put it further down on the to-list. It's something some people would probably want, so hopefully someday it will get done.
Back to top
View user's profile Send private message Send e-mail
CyberSlug



Joined: 08 Mar 2004
Posts: 3

PostPosted: Fri Mar 12, 2004 2:05 am    Post subject: Reply with quote

The 37KB file Wizmo provides standby, hibernate, logoff, reboot, and shutdown plus other stuff Cool
Back to top
View user's profile Send private message
Rajat



Joined: 28 Mar 2004
Posts: 1718

PostPosted: Fri Apr 09, 2004 10:01 pm    Post subject: Reply with quote

had a look at this thread by chance... i'm sure the shutdown question is already solved, i'll still suggest some neat alternatives:

try these commands (sleep / hibernate still elusive to me):

Exit Windows
Run("RUNDLL32.EXE","USER.EXE,ExitWindows")

Restart Windows
Run("RUNDLL32.EXE","USER.EXE,ExitWindowsExec")

Logoff Windows 98 and run Explorer after relogon:
Run("RUNDLL32.EXE",SHELL32.DLL,SHExitWindowsEx 4")
_________________
Back to top
View user's profile Send private message
Beastmaster
Guest





PostPosted: Sat Apr 10, 2004 1:22 pm    Post subject: Reply with quote

I guess what beardboy has recommended (but doesn't want to share with me Laughing ) was this: Suspend.zip
Back to top
Guest






PostPosted: Sun Nov 14, 2004 8:24 pm    Post subject: Suspend commands Reply with quote

Eheh. I should've looked here before I posted. http://www.autohotkey.com/forum/viewtopic.php?p=7592&sid=e4b07ba99fdb951108161048a441d762#7592
Just a note though, the rundll32 commands are outdated in XP (They're still necessary in 9x, ME), shutdown.exe can be used instead. As for suspending, all you need is some vbscript. See my post in the linked thread. Btw, can vbscript be run from inside AHK scripts?
Back to top
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Mon Nov 15, 2004 12:15 am    Post subject: Reply with quote

Quote:
can vbscript be run from inside AHK scripts?
If the .vbs extension is associated with something, you should be able to launch it as a normal document:

Run, something.vbs

For some reason, my XP system appears to be lacking VBS support, so I can't test it.

By the way, thanks for joining the forum Jonny. As an apparent guru, you're a welcome addition.
Back to top
View user's profile Send private message Send e-mail
jonny



Joined: 13 Nov 2004
Posts: 3004
Location: Minnesota

PostPosted: Mon Nov 15, 2004 3:23 pm    Post subject: Reply with quote

Actually, what I meant was can the extraneous vbs file be bypassed altogether? Can you actually put the code into the script and have it run internally, or is it still necessary to have the vbs file? And if it still is, then is there a way to amalgamate it using the AHK compiler?
Back to top
View user's profile Send private message
BoBo
Guest





PostPosted: Mon Nov 15, 2004 3:43 pm    Post subject: Reply with quote

Quote:
For some reason, my XP system appears to be lacking VBS support, so I can't test it


Maybe you've disabled the WHS options for secuity reasons Question
Back to top
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Mon Nov 15, 2004 3:47 pm    Post subject: Reply with quote

jonny wrote:
Actually, what I meant was can the extraneous vbs file be bypassed altogether? Can you actually put the code into the script and have it run internally
Not currently, but it is a planned feature.

Quote:
is there a way to amalgamate it using the AHK compiler?
You could use FileInstall to include a .vbs file with an EXE. I know its rather awkward.

BoBo wrote:
Maybe you've disabled the WHS options for secuity reasons
Thanks for the tip.
Back to top
View user's profile Send private message Send e-mail
jonny



Joined: 13 Nov 2004
Posts: 3004
Location: Minnesota

PostPosted: Mon Nov 15, 2004 5:04 pm    Post subject: Reply with quote

FileInstall... (drooling)... Is there anything AHK can't do? Very Happy Still, I'll be watching for that vbscript inclusion feature.
Back to top
View user's profile Send private message
exhueydriver



Joined: 12 Jul 2004
Posts: 51
Location: Fife,Wa

PostPosted: Tue Nov 16, 2004 2:56 am    Post subject: Reply with quote

I create *.vbs using FileAppend, just replace your <cr>'s with (`n)
i.e. (this is a GoSub)

VBScript:
FileAppend, Set objFM = WScript.CreateObject ("FMPRO.Application")`nobjFM.Visible=True `nSet objFMfiles = objFM.Documents.Open("%FileNamePath%"`,"")`nobjFMfiles.DoFMScript ("%ScriptName%")`nobjFM.Quit, C:\VBsAhkTest.vbs
Run, C:\VBsAhkTest.vbs
Sleep, 750
FileDelete, C:\VBsAhkTest.vbs

Don

I forgot to add, doing it this way, you can pass variables into the .vbs, as you can see in the above.
Back to top
View user's profile Send private message
Guest






PostPosted: Tue Nov 16, 2004 10:47 am    Post subject: Reply with quote

Shocked OMG I never thought of that! That's awesome! Time to go brainstorm the implications...

Aha! People of the AutoHotkey forum, I give you: The vbs2ahk converter! It's really not significant enough to warrant it's own thread, but hey, maybe someone will find it useful. If someone actually cares, I can spiff it up a bit, maybe add support for multiple files at once, and then release it.

Code:
; vbs2ahk script by jonny (copyright everyone)
;
; This script will convert a vbs file into an ad hoc ahk script.
; This does NOT embed the code or convert the code itself to AHK,
; it merely runs the script internally.
;
; It can be run by running the script alone, using dialogs, or
; through the command line. If you use the command line, you must
; include all the parameters or the script will commit honorable
; seppuku. These parameters are,
;
; 1) The input vbs. This can be a relative or absolute path.
; 2) The output ahk. This, too, can be relative or absolute.
; 3) Time in milliseconds to wait for the vbs script to run.
;
; Example: vbs2ahk.exe Shutdown.vbs Shutdown.ahk 1000
;
; No registration required. :-D

If 0 > 0
{
vbs_from = %1%
vbs_to = %2%
vbs_wait = %3%
}
Else
{
FileSelectFile, vbs_from, 3,, Choose the vbs to convert., VBScript (*.vbs)
If vbs_from =
ExitApp
Else
{
InputBox, vbs_to, vbs2ahk, Choose a name for the output ahk.
InputBox, vbs_wait, vbs2ahk, Specify a time in milliseconds to wait for the script to run.`nThis may vary with the size of the script.
}
}
FileAppend, FileAppend`,, %vbs_to%
Loop, Read, %vbs_from%
{
FileAppend, %A_LoopReadLine%``n, %vbs_to%
}
FileAppend, `, 9temp9.vbs`nRun`,9temp9.vbs`nSleep`,%vbs_wait%`nFileDelete`,9temp9.vbs`nReturn,%vbs_to%
Return
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group