Programming my function key F2

  • Thread starter Thread starter tellme
  • Start date Start date
T

tellme

I test a software on XP, and I have to type in the username, password
about 100 times a day. So I made a search on the net on how to program
my function keys, it works, but when I put my vb script on my startup
folder, along with my shortcut to start Outlook, things get really
screed up. What is weird is that it worked for several weeks, I didn't
change anything, now when Outlook starts, I display my first, message
over and over again, even after I closed it 50 times (need to kill
outlook), and yesterday, Outlook started a new message, and I saw my
username/password being typed in my message automatically, over and
over again. What is going on?

Here is my script. (not real passwords). I have a shortcut mapping
this script to CTRL + ALT + 1 (F2). I copy the shortcut in my start
folder.

Set WshShell = WScript.CreateObject("WScript.Shell")

if 1 then
WshShell.SendKeys "USER1{ENTER}"
WshShell.SendKeys "PASS1{ENTER}"
end if

if 0 then
WshShell.SendKeys "USER2{ENTER}"
WshShell.SendKeys "PASS2{ENTER}"
end if
 
Your script is wrong and why is it in Startup - it will be spewing out these keys at logon,

"if 1 then"

If what is 1?

If 1 = True then

is what it means but True IS 1 so this section of code will ALWAYS run

Conversly 0 is false so

If 0 = true then

is always false as 0 is false so this part of the code will NEVER run.
 
The IF 1 THEN is for me to select which login password I need to use. I
only use one pair at a time. So when I want my F2 key to spew such
passord then I edit my SendKey.vbs and put a 1 instead of 0. Placing my
SendKey.vbs and shortcut in my startup is the only way I found to
activate my F2 reprogramming. Right, now its on my desktop and the F2
key does nothing.
 
Fair enough. Most people cut and paste the line and put a comment character at the buginning of one line or another.

Have you rebooted. (all you need do is restart explorer, here's a way -

Ctrl + Alt + Shift and Close or Cancel in the Shutdown dialog
Closes down Window's shell. Use Task Manager's File - Run dialog to start Explorer to restart the shell.).

Hotkeys are read at explorer's startup. If it doesn't take your key there could be another shortcut with that key. The first shoutcut to claim a key wins it. Maybe you are first in startup but something else is when on the desktop. EG Explorer looks at start for hotkeys before lt looks on the desktop. Does assigning another key work?
 
David said:
Does assigning another key work?

Weird. It works now. I re-opened my shortcut, look at the key mapping,
was ALT+CTRL+1 (?). I deleted this and typed F2. F2 appeared as the new
mapping. And now it works fine, even after reboot, and even if my
shortup in only on my desktop. Dont get it, it worked for two
months...the old way?. Must be all these windows update I have every
morning, which I answer yes, out of being fed up with them...

Thanks.
 
Back
Top