PC Review


Reply
Thread Tools Rate Thread

Customised keyboard short cut to activate batch file not working

 
 
redyellowgreenblue@gmail.com
Guest
Posts: n/a
 
      27th Oct 2008
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?
 
Reply With Quote
 
 
 
 
Pegasus \(MVP\)
Guest
Posts: n/a
 
      27th Oct 2008

<(E-Mail Removed)> wrote in message
news:cf78b5f3-94d3-47da-925b-(E-Mail Removed)...
> 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.


 
Reply With Quote
 
Nepatsfan
Guest
Posts: n/a
 
      27th Oct 2008
<(E-Mail Removed)> wrote in message
news:cf78b5f3-94d3-47da-925b-(E-Mail Removed)...
> 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


 
Reply With Quote
 
Member
Join Date: Oct 2005
Posts: 32
 
      8th May 2010
Quote:
Originally Posted by (E-Mail Removed)
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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
The keyboard short for paste special is not working =?Utf-8?B?TGluZHNheQ==?= Microsoft Excel Crashes 0 2nd Aug 2006 06:49 PM
Short filenames sent to batch file through context menu Yan Bilik Windows XP General 3 25th Jun 2004 03:06 PM
How to activate dial-up connection through a batch file? Brock Windows XP General 1 10th Mar 2004 08:45 PM
Macro to activate a Batch file ! Tarek Microsoft Excel Programming 3 13th Oct 2003 08:02 PM
Keyboard function key or short key not working Sarfaraz Khan Windows XP Hardware 1 27th Sep 2003 03:00 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:09 AM.