![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Two script questions: send Fn key? and detect profile loaded? I have a small script to launch a program on my laptop. I'd like to put this script into the startup folder of the profile I use, but I don't want the script to run until the laptop has finished booting and the profile is completely loaded. Can I detect when the profile is finished loading and run the script then? Or perhaps just put in several seconds of sleep and make it wait that way? Also, I'd like to see if I can somehow send a Function (Fn) key combination via the script. Will SendKeys work with Fn? Ed |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Two script questions: send Fn key? and detect profile loaded? On Jan 27, 1:56*pm, Ed from AZ <prof_ofw...@xxxxxx> wrote: Quote: > I have a small script to launch a program on my laptop. *I'd like to > put this script into the startup folder of the profile I use, but I > don't want the script to run until the laptop has finished booting and > the profile is completely loaded. *Can I detect when the profile is > finished loading and run the script then? *Or perhaps just put in > several seconds of sleep and make it wait that way? > > Also, I'd like to see if I can somehow send a Function (Fn) key > combination via the script. *Will SendKeys work with Fn? > > Ed \Startup" folder do the job you want? If it doesn't you can certainly add a WSH.Sleep 10000 line at the head of the script. An Sendkey sends function keys as {Fn}, when n is the number of the desired key ({F1}, {F2}, ...). The tough part is making sure it is sent to the right application. That requires judicious use of the AppActivate method. Tom Lavedas *********** http://there.is.no.more/tglbatch/ |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Two script questions: send Fn key? and detect profile loaded? Hi, Tom. Thanks for responding. Quote: > Doesn't a shortcut in the "%userprofile%\Start Menu\Programs > \Startup" folder do the job you want? If it doesn't you can certainly > add a WSH.Sleep 10000 line at the head of the script. I wanted to check and see if there was a way to detect the end of the load-up process first. I do intend on putting it there - I just want the script to be the last thing to run. Quote: > An Sendkey sends function keys as {Fn}, when n is the number of the > desired key ({F1}, {F2}, ...). The tough part is making sure it is > sent to the right application. That requires judicious use of the > AppActivate method. activates something specific to the Dell scheme of things, I suspect (turning off the WiFi antenna). So I want to send the "Fn" button plus the "F2" button after Windows XP Pro finishes loading, but it does something within Dell's influence, I think, rather than to Windows or any other app. Ed On Jan 27, 1:23*pm, Tom Lavedas <tglba...@xxxxxx> wrote: Quote: > On Jan 27, 1:56*pm, Ed from AZ <prof_ofw...@xxxxxx> wrote: > Quote: > > I have a small script to launch a program on my laptop. *I'd like to > > put this script into the startup folder of the profile I use, but I > > don't want the script to run until the laptop has finished booting and > > the profile is completely loaded. *Can I detect when the profile is > > finished loading and run the script then? *Or perhaps just put in > > several seconds of sleep and make it wait that way? Quote: > > Also, I'd like to see if I can somehow send a Function (Fn) key > > combination via the script. *Will SendKeys work with Fn? Quote: > > Ed > Doesn't the a shortcut in the "%userprofile%\Start Menu\Programs > \Startup" folder do the job you want? *If it doesn't you can certainly > add a WSH.Sleep 10000 line at the head of the script. > > An Sendkey sends function keys as {Fn}, when n is the number of the > desired key ({F1}, {F2}, ...). *The tough part is making sure it is > sent to the right application. *That requires judicious use of the > AppActivate method. > > Tom Lavedas > ***********http://there.is.no.more/tglbatch/ |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Two script questions: send Fn key? and detect profile loaded? "Ed from AZ" <prof_ofwhat@xxxxxx> wrote in message news:381f05f5-cffd-46e0-a612-b4787c43cffd@xxxxxx Hi, Tom. Thanks for responding. Quote: > Doesn't a shortcut in the "%userprofile%\Start Menu\Programs > \Startup" folder do the job you want? If it doesn't you can certainly > add a WSH.Sleep 10000 line at the head of the script. I wanted to check and see if there was a way to detect the end of the load-up process first. I do intend on putting it there - I just want the script to be the last thing to run. ===> I bel Quote: > An Sendkey sends function keys as {Fn}, when n is the number of the > desired key ({F1}, {F2}, ...). The tough part is making sure it is > sent to the right application. That requires judicious use of the > AppActivate method. activates something specific to the Dell scheme of things, I suspect (turning off the WiFi antenna). So I want to send the "Fn" button plus the "F2" button after Windows XP Pro finishes loading, but it does something within Dell's influence, I think, rather than to Windows or any other app. Ed On Jan 27, 1:23 pm, Tom Lavedas <tglba...@xxxxxx> wrote: Quote: > On Jan 27, 1:56 pm, Ed from AZ <prof_ofw...@xxxxxx> wrote: > Quote: > > I have a small script to launch a program on my laptop. I'd like to > > put this script into the startup folder of the profile I use, but I > > don't want the script to run until the laptop has finished booting and > > the profile is completely loaded. Can I detect when the profile is > > finished loading and run the script then? Or perhaps just put in > > several seconds of sleep and make it wait that way? Quote: > > Also, I'd like to see if I can somehow send a Function (Fn) key > > combination via the script. Will SendKeys work with Fn? Quote: > > Ed > Doesn't the a shortcut in the "%userprofile%\Start Menu\Programs > \Startup" folder do the job you want? If it doesn't you can certainly > add a WSH.Sleep 10000 line at the head of the script. > > An Sendkey sends function keys as {Fn}, when n is the number of the > desired key ({F1}, {F2}, ...). The tough part is making sure it is > sent to the right application. That requires judicious use of the > AppActivate method. > > Tom Lavedas > ***********http://there.is.no.more/tglbatch/ |
My System Specs![]() |
| | #5 (permalink) |
| | Re: Two script questions: send Fn key? and detect profile loaded? "Ed from AZ" <prof_ofwhat@xxxxxx> wrote in message news:381f05f5-cffd-46e0-a612-b4787c43cffd@xxxxxx Hi, Tom. Thanks for responding. Quote: > Doesn't a shortcut in the "%userprofile%\Start Menu\Programs > \Startup" folder do the job you want? If it doesn't you can certainly > add a WSH.Sleep 10000 line at the head of the script. I wanted to check and see if there was a way to detect the end of the load-up process first. I do intend on putting it there - I just want the script to be the last thing to run. ===> I believe that nothing runs from the startup folder until the system is fully booted and operational. I don't know of any way to pre-determine the order of execution from the startup folder - I think they all run asynchronously. Quote: > An Sendkey sends function keys as {Fn}, when n is the number of the > desired key ({F1}, {F2}, ...). The tough part is making sure it is > sent to the right application. That requires judicious use of the > AppActivate method. activates something specific to the Dell scheme of things, I suspect (turning off the WiFi antenna). So I want to send the "Fn" button plus the "F2" button after Windows XP Pro finishes loading, but it does something within Dell's influence, I think, rather than to Windows or any other app. ===> sendkeys can only deal with keys known to and processed by windows. In most cases, the FN key deals directly with the hardware, and not through the o/s. Ed On Jan 27, 1:23 pm, Tom Lavedas <tglba...@xxxxxx> wrote: Quote: > On Jan 27, 1:56 pm, Ed from AZ <prof_ofw...@xxxxxx> wrote: > Quote: > > I have a small script to launch a program on my laptop. I'd like to > > put this script into the startup folder of the profile I use, but I > > don't want the script to run until the laptop has finished booting and > > the profile is completely loaded. Can I detect when the profile is > > finished loading and run the script then? Or perhaps just put in > > several seconds of sleep and make it wait that way? Quote: > > Also, I'd like to see if I can somehow send a Function (Fn) key > > combination via the script. Will SendKeys work with Fn? Quote: > > Ed > Doesn't the a shortcut in the "%userprofile%\Start Menu\Programs > \Startup" folder do the job you want? If it doesn't you can certainly > add a WSH.Sleep 10000 line at the head of the script. > > An Sendkey sends function keys as {Fn}, when n is the number of the > desired key ({F1}, {F2}, ...). The tough part is making sure it is > sent to the right application. That requires judicious use of the > AppActivate method. > > Tom Lavedas > ***********http://there.is.no.more/tglbatch/ |
My System Specs![]() |
| | #6 (permalink) |
| | Re: Two script questions: send Fn key? and detect profile loaded? "Ed from AZ" <prof_ofwhat@xxxxxx> wrote in message news:5dae9c76-36e4-4256-ab9a-0c0667053c13@xxxxxx Quote: >I have a small script to launch a program on my laptop. I'd like to > put this script into the startup folder of the profile I use, but I > don't want the script to run until the laptop has finished booting and > the profile is completely loaded. Can I detect when the profile is > finished loading and run the script then? Or perhaps just put in > several seconds of sleep and make it wait that way? > > Also, I'd like to see if I can somehow send a Function (Fn) key > combination via the script. Will SendKeys work with Fn? In 1998, Rob Blackmore posted the following. <HTML> <INPUT TYPE=TEXT NAME="txtField" SIZE=40> </HTML> <SCRIPT LANGUAGE="VBScript"> SUB txtField_OnKeyDown msgbox window.event.keycode END SUB </SCRIPT> Copy the code above to a .htm file, and run it. Put the cursor in the input box in the HTML window and press various keys. On my Compaq laptop, pressing the Fn key does not trigger the OnKeyDown event; I think all the other keys on my keyboard are seen by this event. Hopefully someone will find a way to do something with the Fn key. |
My System Specs![]() |
| | #7 (permalink) |
| | Re: Two script questions: send Fn key? and detect profile loaded? "Paul Randall" <paulr90@xxxxxx> wrote in message news:ODse71XgJHA.5556@xxxxxx Quote: > > "Ed from AZ" <prof_ofwhat@xxxxxx> wrote in message > news:5dae9c76-36e4-4256-ab9a-0c0667053c13@xxxxxx Quote: >>I have a small script to launch a program on my laptop. I'd like to >> put this script into the startup folder of the profile I use, but I >> don't want the script to run until the laptop has finished booting and >> the profile is completely loaded. Can I detect when the profile is >> finished loading and run the script then? Or perhaps just put in >> several seconds of sleep and make it wait that way? >> >> Also, I'd like to see if I can somehow send a Function (Fn) key >> combination via the script. Will SendKeys work with Fn? > Hi, Ed > > In 1998, Rob Blackmore posted the following. > > <HTML> > <INPUT TYPE=TEXT NAME="txtField" SIZE=40> > </HTML> > > <SCRIPT LANGUAGE="VBScript"> > > SUB txtField_OnKeyDown > msgbox window.event.keycode > END SUB > > </SCRIPT> > > Copy the code above to a .htm file, and run it. Put the cursor in the > input box in the HTML window and press various keys. On my Compaq laptop, > pressing the Fn key does not trigger the OnKeyDown event; I think all the > other keys on my keyboard are seen by this event. Hopefully someone will > find a way to do something with the Fn key. pressing several keys, one after the other: - Ctrl 17 - Fn 255 - Fn, then Ctrl 255 255 I suspect that Fn keys are hardwired and need special methods to pick them up. |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| The User Profile Service failed the logon. User profile cannot be loaded. | Tutorials | |||
| "Profile not loaded correctly" and other questions | Vista General | |||
| The User Profile Service failed the logon. User profile cannot be loaded. | Vista General | |||
| "Your user profile was not loaded correctly" with roaming profile in AD domain | Vista General | |||
| Vista Roaming Profile Questions (Default Profile & User Folder on Desktop) | Vista networking & sharing | |||