From: Terry Pinnell on
On this XP Pro (SP2) PC I cannot get any shortcut keys to work on the
shortcuts made from any batch file.

For example, Test-01.bat contains this

@echo off
pause

I assigned it the shortcut <Ctl+Alt+3> (or any keys) as shown here

http://dl.dropbox.com/u/4019461/BatchProblem.jpg

But it doesn't run when I use the keys.

It runs fine if I d-click either the original batch file or its shortcut.

No difference after a reboot.

I installed a little program called Shortcut Key Explorer v1 01 by RJL
Software from http://www.rjlsoftware.com/software/utility/shortcutkeys/
which lists all the keyboard shortcuts in use. It found the couple I've
successfully installed, such as a test with Calculator. But for the test
batch file, even though it's shown as having ctl-alt-3 assigned in
the Properties, the Shortcutkeys list doesn't include it.

Very frustrating!

Anyone have any ideas please?

--
Terry, East Grinstead, UK
From: Pegasus [MVP] on


"Terry Pinnell" <terrypinDELETE(a)THESEdial.pipex.com> wrote in message
news:2vbau5lh4get4jelqe8f0t7d0b21pag5ab(a)4ax.com...
> On this XP Pro (SP2) PC I cannot get any shortcut keys to work on the
> shortcuts made from any batch file.
>
> For example, Test-01.bat contains this
>
> @echo off
> pause
>
> I assigned it the shortcut <Ctl+Alt+3> (or any keys) as shown here
>
> http://dl.dropbox.com/u/4019461/BatchProblem.jpg
>
> But it doesn't run when I use the keys.
>
> It runs fine if I d-click either the original batch file or its shortcut.
>
> No difference after a reboot.
>
> I installed a little program called Shortcut Key Explorer v1 01 by RJL
> Software from http://www.rjlsoftware.com/software/utility/shortcutkeys/
> which lists all the keyboard shortcuts in use. It found the couple I've
> successfully installed, such as a test with Calculator. But for the test
> batch file, even though it's shown as having ctl-alt-3 assigned in
> the Properties, the Shortcutkeys list doesn't include it.
>
> Very frustrating!
>
> Anyone have any ideas please?
>
> --
> Terry, East Grinstead, UK

Perhaps you need to invoke your batch file like so in the shortcut:
cmd /c "c:\Tools\MyBatchfile.bat

About the list of current shortcuts: Try the following.
1. Copy and paste the code below into c:\Windows\ShortcutKeys.vbs
2. Double-click it. It will scan each and every shortcut you have and report
if there is a shortcut key combination.
3. Report the result.

aKeys = Split("Ctrl+Shift,"",Alt+Shift,Alt+Ctrl", ",")
Set oWshShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
sList = "\Links.txt"
sProfiles = oWshShell.ExpandEnvironmentStrings("%UserProfile%\..")
sTemp = oWshShell.ExpandEnvironmentStrings("%Temp%")
oWshShell.Run "cmd.exe /u /c dir /s /a /b """ & sProfiles & "\*.lnk"" > """
_
& sTemp & sList & "", 0, True 'Use Unicode for non-ASCII file names

Set oList = oFSO.OpenTextFile(sTemp & sList, 1, False, -1) 'Read the names
in Unicode format
aLinks = Split(oList.ReadAll, VbCrLf)
oList.Close
oFSO.DeleteFile (sTemp & sList)

iCount = 0
For Each sName In (aLinks)
If sName <> "" Then
iCount = iCount + 1
sString = oFSO.OpenTextFile(sName).Read(70)
cKey = Mid(sString, 66, 1) 'The bytes are read in reverse order . . .
Letter = Mid(sString, 65, 1)
If cKey <> Chr(0) Then MsgBox aKeys(Asc(cKey)-3) & "+" & Letter & " " &
sName, vbOK, "Link file keyboard shortcuts"
End If
Next


From: dadiOH on
Terry Pinnell wrote:
> On this XP Pro (SP2) PC I cannot get any shortcut keys to work on the
> shortcuts made from any batch file.
>
> For example, Test-01.bat contains this
>
> @echo off
> pause
>
> I assigned it the shortcut <Ctl+Alt+3> (or any keys) as shown here
>
> http://dl.dropbox.com/u/4019461/BatchProblem.jpg
>
> But it doesn't run when I use the keys.
>
> It runs fine if I d-click either the original batch file or its
> shortcut.
>
> No difference after a reboot.
>
> I installed a little program called Shortcut Key Explorer v1 01 by RJL
> Software from
> http://www.rjlsoftware.com/software/utility/shortcutkeys/ which lists
> all the keyboard shortcuts in use. It found the couple I've
> successfully installed, such as a test with Calculator. But for the
> test batch file, even though it's shown as having ctl-alt-3 assigned
> in
> the Properties, the Shortcutkeys list doesn't include it.
>
> Very frustrating!
>
> Anyone have any ideas please?

Don't know about your specific problem but normally shortcuts being invoked
via a keyboard combo have to be in either the desktop or Start/Programs. Try
moving the shortcut to one of those.

--

dadiOH
____________________________

dadiOH's dandies v3.06...
....a help file of info about MP3s, recording from
LP/cassette and tips & tricks on this and that.
Get it at http://mysite.verizon.net/xico



From: Terry Pinnell on
"Pegasus [MVP]" <news(a)microsoft.com> wrote:

>
>
>"Terry Pinnell" <terrypinDELETE(a)THESEdial.pipex.com> wrote in message
>news:2vbau5lh4get4jelqe8f0t7d0b21pag5ab(a)4ax.com...
>> On this XP Pro (SP2) PC I cannot get any shortcut keys to work on the
>> shortcuts made from any batch file.
>>
>> For example, Test-01.bat contains this
>>
>> @echo off
>> pause
>>
>> I assigned it the shortcut <Ctl+Alt+3> (or any keys) as shown here
>>
>> http://dl.dropbox.com/u/4019461/BatchProblem.jpg
>>
>> But it doesn't run when I use the keys.
>>
>> It runs fine if I d-click either the original batch file or its shortcut.
>>
>> No difference after a reboot.
>>
>> I installed a little program called Shortcut Key Explorer v1 01 by RJL
>> Software from http://www.rjlsoftware.com/software/utility/shortcutkeys/
>> which lists all the keyboard shortcuts in use. It found the couple I've
>> successfully installed, such as a test with Calculator. But for the test
>> batch file, even though it's shown as having ctl-alt-3 assigned in
>> the Properties, the Shortcutkeys list doesn't include it.
>>
>> Very frustrating!
>>
>> Anyone have any ideas please?
>>
>> --
>> Terry, East Grinstead, UK
>
>Perhaps you need to invoke your batch file like so in the shortcut:
>cmd /c "c:\Tools\MyBatchfile.bat

Thanks Pegasus, but that still didn't fix it. See also my reply to dadiOH.

>About the list of current shortcuts: Try the following.
>1. Copy and paste the code below into c:\Windows\ShortcutKeys.vbs
>2. Double-click it. It will scan each and every shortcut you have and report
>if there is a shortcut key combination.
>3. Report the result.
>
>aKeys = Split("Ctrl+Shift,"",Alt+Shift,Alt+Ctrl", ",")
>Set oWshShell = CreateObject("WScript.Shell")
>Set oFSO = CreateObject("Scripting.FileSystemObject")
>sList = "\Links.txt"
>sProfiles = oWshShell.ExpandEnvironmentStrings("%UserProfile%\..")
>sTemp = oWshShell.ExpandEnvironmentStrings("%Temp%")
>oWshShell.Run "cmd.exe /u /c dir /s /a /b """ & sProfiles & "\*.lnk"" > """
>_
> & sTemp & sList & "", 0, True 'Use Unicode for non-ASCII file names
>
>Set oList = oFSO.OpenTextFile(sTemp & sList, 1, False, -1) 'Read the names
>in Unicode format
>aLinks = Split(oList.ReadAll, VbCrLf)
>oList.Close
>oFSO.DeleteFile (sTemp & sList)
>
>iCount = 0
>For Each sName In (aLinks)
> If sName <> "" Then
> iCount = iCount + 1
> sString = oFSO.OpenTextFile(sName).Read(70)
> cKey = Mid(sString, 66, 1) 'The bytes are read in reverse order . . .
> Letter = Mid(sString, 65, 1)
> If cKey <> Chr(0) Then MsgBox aKeys(Asc(cKey)-3) & "+" & Letter & " " &
>sName, vbOK, "Link file keyboard shortcuts"
> End If
>Next
>

Running it gave me an error message titled Windows Script Host:

Script: C:\WINDOWS\ShortcutKeys.vbs
Line: 9
Char: 3
Error: Expected statement
Code: 800A0400
Source: Microsoft VBScript compilation error

Running the utility I mentioned (of the same name) seems to do the job of
identifying valid (i.e. working) keyboard shortcuts however.

--
Terry, East Grinstead, UK
From: Terry Pinnell on
"dadiOH" <dadiOH(a)invalid.com> wrote:

>Terry Pinnell wrote:
>> On this XP Pro (SP2) PC I cannot get any shortcut keys to work on the
>> shortcuts made from any batch file.
>>
>> For example, Test-01.bat contains this
>>
>> @echo off
>> pause
>>
>> I assigned it the shortcut <Ctl+Alt+3> (or any keys) as shown here
>>
>> http://dl.dropbox.com/u/4019461/BatchProblem.jpg
>>
>> But it doesn't run when I use the keys.
>>
>> It runs fine if I d-click either the original batch file or its
>> shortcut.
>>
>> No difference after a reboot.
>>
>> I installed a little program called Shortcut Key Explorer v1 01 by RJL
>> Software from
>> http://www.rjlsoftware.com/software/utility/shortcutkeys/ which lists
>> all the keyboard shortcuts in use. It found the couple I've
>> successfully installed, such as a test with Calculator. But for the
>> test batch file, even though it's shown as having ctl-alt-3 assigned
>> in
>> the Properties, the Shortcutkeys list doesn't include it.
>>
>> Very frustrating!
>>
>> Anyone have any ideas please?
>
>Don't know about your specific problem but normally shortcuts being invoked
>via a keyboard combo have to be in either the desktop or Start/Programs. Try
>moving the shortcut to one of those.

Thanks dadiOH, that's a breakthrough.

I was using a simple batch file for testing:

Test-01.bat
-----------
@echo off
pause

But it would not run from a keyboard shortcut. After moving the shortcuts
from C:\Batch to C:\Documents and Settings\All Users\Start
Menu\Programs\Batch as you suggested, it now does - EVENTUALLY.

It is taking some 20 seconds to run any shortcut with a keyboard shortcut!
This applies to ALL the shortcuts I've tried, not just those to batch files.
For example, shortcuts to Notepad, Calculator, etc. Yet all run immediately
if I d-click the shortcut instead of using the keyboard.

Any idea what on earth can be happening to take 20 seconds or so?!

I'll reboot after posting this to see if that makes any difference.

--
Terry, East Grinstead, UK