Customised keyboard short cut to activate batch file not working

R

redyellowgreenblue

Hi

I've set-up a batch file to automatically hibernate my computer (the
code is "RUNDLL32.EXE PowrProf.dll,SetSuspendState").

I've then created a shortcut to this on the desktop, and assigned it
the keyboard shortcut CTRL+ALT+H using the /Properties/Shortcut
option.

But it doesn't work. Actually, it worked once, but then never again.
I've tried it with no other programs running, but no luck.

Should customised keyboard short cuts work to activate batch files?
 
P

Pegasus \(MVP\)

Hi

I've set-up a batch file to automatically hibernate my computer (the
code is "RUNDLL32.EXE PowrProf.dll,SetSuspendState").

I've then created a shortcut to this on the desktop, and assigned it
the keyboard shortcut CTRL+ALT+H using the /Properties/Shortcut
option.

But it doesn't work. Actually, it worked once, but then never again.
I've tried it with no other programs running, but no luck.

Should customised keyboard short cuts work to activate batch files?

As Julius Cesar said: Divide and conquer! In other words, your first step
should be to divide the two functions, then find out which one does not
work. The functions are:

Function 1: Invoke the shortcut using Ctrl+Alt+H
Function 2: Run rundll32.exe

You can test Function 2 by manually double-clicking your shortcut directly.

You can test Function 1 by pointing it at a batch file. The batch file
should contain the following three lines:
@echo off
echo %date% %time% %Username% >> c:\test.txt
RUNDLL32.EXE PowrProf.dll,SetSuspendState 1>> c:\test.txt 2>>&1

Now click Ctrl+Alt+H, then examine c:\test.txt. Does it exist? Does it
contain a date stamp?

By the way, my computer, like many others, has an inbuilt keyboard shortcut
to force Windows into hibernation: Fn+F4. You might want to check your
manual to see if you don't have a smiliar inbuilt shortcut.
 
N

Nepatsfan

Hi

I've set-up a batch file to automatically hibernate my computer (the
code is "RUNDLL32.EXE PowrProf.dll,SetSuspendState").

I've then created a shortcut to this on the desktop, and assigned it
the keyboard shortcut CTRL+ALT+H using the /Properties/Shortcut
option.

But it doesn't work. Actually, it worked once, but then never again.
I've tried it with no other programs running, but no luck.

Should customised keyboard short cuts work to activate batch files?


Just out of curiosity, is there some reason you've made this complicated by
using a batch file?

Instead of having your desktop shortcut point to your batch file, enter the
following command in the Target box on the Shortcut page of the desktop
shortcut's Properties sheet.

%windir%\system32\rundll32.exe PowrProf.dll, SetSuspendState

Click in the Shortcut key box.
Hit the H key.
Click OK.

See what happens when you hit Ctrl + Alt + H.

Good luck

Nepatsfan
 
Joined
Oct 3, 2005
Messages
32
Reaction score
0
Hi

I've set-up a batch file to automatically hibernate my computer (the
code is "RUNDLL32.EXE PowrProf.dll,SetSuspendState").

I've then created a shortcut to this on the desktop, and assigned it
the keyboard shortcut CTRL+ALT+H using the /Properties/Shortcut
option.

But it doesn't work. Actually, it worked once, but then never again.
I've tried it with no other programs running, but no luck.

Should customised keyboard short cuts work to activate batch files?

Did you ever get a clear answer to this please? I've arrived here in this old thread while searching for a solution to exactly the same question. Running XP Pro, I can't get any shortcuts to batch files to work with a keyboard shortcut.

--
Terry, East Grinstead, UK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top