Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
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.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - How do i send CTRL + * in the sendkeys method

Reply
 
Old 4 Weeks Ago   #1 (permalink)
Harish_Sasikumar


 
 

How do i send CTRL + * in the sendkeys method

Hi,

I am required to use keystrokes for the purpose of Test automation

Set oShell = CreateObject("WScript.Shell")
Please correct me on what should be used for (CTRL + *)?
Would the following workout?
oShell.SendKeys("^*") or oShell.SendKeys("^(*)") ?

Regards,
Harish

My System SpecsSystem Spec
Old 4 Weeks Ago   #2 (permalink)
Paul Randall


 
 

Re: How do i send CTRL + * in the sendkeys method


"Harish_Sasikumar" <harishsasikumar@newsgroup> wrote in message
news:22b81c73-7e8d-4c03-8f2d-52e887d8240a@newsgroup
Quote:

> Hi,
>
> I am required to use keystrokes for the purpose of Test automation
>
> Set oShell = CreateObject("WScript.Shell")
> Please correct me on what should be used for (CTRL + *)?
> Would the following workout?
> oShell.SendKeys("^*") or oShell.SendKeys("^(*)") ?
Have you tried looking for information in the scripting help file,
script56.chm?
Try this link (its all one line), but substitute the path to your help file:
mk:@MSITStore:C:\Documents%20and%20Settings\aaPaul\Desktop\Vbsedit\script56.chm::/html/4b032417-ebda-4d30-88a4-2b56c24affdd.htm

If you don't have the help file on your system, download it through the
downloads link at msdn.microsoft.com; note that you may have to right click
on the downloaded help file and choose 'unblock' before it works right.

-Paul Randall


My System SpecsSystem Spec
Old 4 Weeks Ago   #3 (permalink)
Harish_Sasikumar


 
 

Re: How do i send CTRL + * in the sendkeys method

On Oct 27, 4:31*pm, "Paul Randall" <paulr...@newsgroup> wrote:
Quote:

> "Harish_Sasikumar" <harishsasiku...@newsgroup> wrote in message
>
> news:22b81c73-7e8d-4c03-8f2d-52e887d8240a@newsgroup
>
Quote:

> > Hi,
>
Quote:

> > I am required to use keystrokes for the purpose of Test automation
>
Quote:

> > Set oShell = CreateObject("WScript.Shell")
> > Please correct me on what should be used for (CTRL + *)?
> > Would the following workout?
> > oShell.SendKeys("^*") *or oShell.SendKeys("^(*)") ?
>
> Have you tried looking for information in the scripting help file,
> script56.chm?
> Try this link (its all one line), but substitute the path to your help file:
> mk:@MSITStore:C:\Documents%20and%20Settings\aaPaul\Desktop\Vbsedit\script56*.chm::/html/4b032417-ebda-4d30-88a4-2b56c24affdd.htm
>
> If you don't have the help file on your system, download it through the
> downloads link at msdn.microsoft.com; note that you may have to right click
> on the downloaded help file and choose 'unblock' before it works right.
>
> -Paul Randall
Yes, i did go through msdn but it never specifically gave an example
to send the Ctrl and asterisk combination
if u have noted, asterisk is placed on the upper part,below it is
8.For which the sendkey method doesnt take asterisk.I did try "^8", it
worked.
But i am not sure if its the correct approach.

-HS
My System SpecsSystem Spec
Old 4 Weeks Ago   #4 (permalink)
Pegasus [MVP]


 
 

Re: How do i send CTRL + * in the sendkeys method


"Harish_Sasikumar" <harishsasikumar@newsgroup> wrote in message
news:ff936c6f-af0f-4bc4-9e9a-f32f1fdf6895@newsgroup
On Oct 27, 4:31 pm, "Paul Randall" <paulr...@newsgroup> wrote:
Quote:

> "Harish_Sasikumar" <harishsasiku...@newsgroup> wrote in message
>
> news:22b81c73-7e8d-4c03-8f2d-52e887d8240a@newsgroup
>
Quote:

> > Hi,
>
Quote:

> > I am required to use keystrokes for the purpose of Test automation
>
Quote:

> > Set oShell = CreateObject("WScript.Shell")
> > Please correct me on what should be used for (CTRL + *)?
> > Would the following workout?
> > oShell.SendKeys("^*") or oShell.SendKeys("^(*)") ?
>
> Have you tried looking for information in the scripting help file,
> script56.chm?
> Try this link (its all one line), but substitute the path to your help
> file:
> mk:@MSITStore:C:\Documents%20and%20Settings\aaPaul\Desktop\Vbsedit\script56*.chm::/html/4b032417-ebda-4d30-88a4-2b56c24affdd.htm
>
> If you don't have the help file on your system, download it through the
> downloads link at msdn.microsoft.com; note that you may have to right
> click
> on the downloaded help file and choose 'unblock' before it works right.
>
> -Paul Randall
Yes, i did go through msdn but it never specifically gave an example
to send the Ctrl and asterisk combination
if u have noted, asterisk is placed on the upper part,below it is
8.For which the sendkey method doesnt take asterisk.I did try "^8", it
worked.
But i am not sure if its the correct approach.

-HS

=============

Here is the relevant text from script56.chm:

To send keyboard characters that are comprised of a regular keystroke in
combination with a SHIFT, CTRL, or ALT, create a compound string argument
that represents the keystroke combination. You do this by preceding the
regular keystroke with one or more of the following special characters:

Key Special Character
SHIFT +
CTRL ^
ALT %

As you see, it says specifically "precede the regular keystroke with ^",
which is what you appear to have found out by trial and error.


My System SpecsSystem Spec
Old 4 Weeks Ago   #5 (permalink)
Paul Randall


 
 

Re: How do i send CTRL + * in the sendkeys method


"Harish_Sasikumar" <harishsasikumar@newsgroup> wrote in message
news:ff936c6f-af0f-4bc4-9e9a-f32f1fdf6895@newsgroup
On Oct 27, 4:31 pm, "Paul Randall" <paulr...@newsgroup> wrote:
Quote:

> "Harish_Sasikumar" <harishsasiku...@newsgroup> wrote in message
>
> news:22b81c73-7e8d-4c03-8f2d-52e887d8240a@newsgroup
>
Quote:

> > Hi,
>
Quote:

> > I am required to use keystrokes for the purpose of Test automation
>
Quote:

> > Set oShell = CreateObject("WScript.Shell")
> > Please correct me on what should be used for (CTRL + *)?
> > Would the following workout?
> > oShell.SendKeys("^*") or oShell.SendKeys("^(*)") ?
>
> Have you tried looking for information in the scripting help file,
> script56.chm?
> Try this link (its all one line), but substitute the path to your help
> file:
> mk:@MSITStore:C:\Documents%20and%20Settings\aaPaul\Desktop\Vbsedit\script56*.chm::/html/4b032417-ebda-4d30-88a4-2b56c24affdd.htm
>
> If you don't have the help file on your system, download it through the
> downloads link at msdn.microsoft.com; note that you may have to right
> click
> on the downloaded help file and choose 'unblock' before it works right.
>
> -Paul Randall
Yes, i did go through msdn but it never specifically gave an example
to send the Ctrl and asterisk combination
if u have noted, asterisk is placed on the upper part,below it is
8.For which the sendkey method doesnt take asterisk.I did try "^8", it
worked.
But i am not sure if its the correct approach.

-HS
-------------------------------------------------------------

In the scripting help file's index tab, type in the word processid, and hit
enter.
The page should have a VBScript that uses the sendkeys method to run
calculator and do control-C to copy the calculator's result to the
clipboard, and then uses sendkeys to do control-V to paste the clpboard
contents into Notepad. The example demonstrates that for most shifted
characters (such as ~ ; asterisk works the same way), you can type the
shifted character into the string to be sent. You might want to set up a
script to type all the unshifted and shifted characters to Notepad just to
understand how it works.

Note too that if some window pops up while your script is running, that
window will become the active window, an it will get those keystrokes.
Sendkeys is not a reliable way to interact with a window unless you have a
way to prevent other windows from being activated.

Let us know if you need further help.

-Paul Randall


My System SpecsSystem Spec
Old 4 Weeks Ago   #6 (permalink)
Harish_Sasikumar


 
 

Re: How do i send CTRL + * in the sendkeys method

On Oct 28, 2:40*pm, "Paul Randall" <paulr...@newsgroup> wrote:
Quote:

> "Harish_Sasikumar" <harishsasiku...@newsgroup> wrote in message
>
> news:ff936c6f-af0f-4bc4-9e9a-f32f1fdf6895@newsgroup
> On Oct 27, 4:31 pm, "Paul Randall" <paulr...@newsgroup> wrote:
>
>
>
>
>
Quote:

> > "Harish_Sasikumar" <harishsasiku...@newsgroup> wrote in message
>
Quote:

> >news:22b81c73-7e8d-4c03-8f2d-52e887d8240a@newsgroup
>
Quote:
Quote:

> > > Hi,
>
Quote:
Quote:

> > > I am required to use keystrokes for the purpose of Test automation
>
Quote:
Quote:

> > > Set oShell = CreateObject("WScript.Shell")
> > > Please correct me on what should be used for (CTRL + *)?
> > > Would the following workout?
> > > oShell.SendKeys("^*") or oShell.SendKeys("^(*)") ?
>
Quote:

> > Have you tried looking for information in the scripting help file,
> > script56.chm?
> > Try this link (its all one line), but substitute the path to your help
> > file:
> > mk:@MSITStore:C:\Documents%20and%20Settings\aaPaul\Desktop\Vbsedit\script56**.chm::/html/4b032417-ebda-4d30-88a4-2b56c24affdd.htm
>
Quote:

> > If you don't have the help file on your system, download it through the
> > downloads link at msdn.microsoft.com; note that you may have to right
> > click
> > on the downloaded help file and choose 'unblock' before it works right.
>
Quote:

> > -Paul Randall
>
> Yes, i did go through msdn but it never specifically gave an example
> to send the Ctrl and asterisk combination
> if u have noted, asterisk is placed on the upper part,below it is
> 8.For which the sendkey method doesnt take asterisk.I did try "^8", it
> worked.
> But i am not sure if its the correct approach.
>
> -HS
> -------------------------------------------------------------
>
> In the scripting help file's index tab, type in the word processid, and hit
> enter.
> The page should have a VBScript that uses the sendkeys method to run
> calculator and do control-C to copy the calculator's result to the
> clipboard, and then uses sendkeys to do control-V to paste the clpboard
> contents into Notepad. *The example demonstrates that for most shifted
> characters (such as ~ ; asterisk works the same way), you can type the
> shifted character into the string to be sent. *You might want to set upa
> script to type all the unshifted and shifted characters to Notepad just to
> understand how it works.
>
> Note too that if some window pops up while your script is running, that
> window will become the active window, an it will get those keystrokes.
> Sendkeys is not a reliable way to interact with a window unless you have a
> way to prevent other windows from being activated.
>
> Let us know if you need further help.
>
> -Paul Randall- Hide quoted text -
>
> - Show quoted text -
Hi all,

Appreciate everyones help.It has been informative and useful.

-HS
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Method invocation failed because [System.String] doesn't contain a method PowerShell
Replacement for SendKeys.Send "{F1}" necessary? Vista General
How-to send CTRL+Z command in PowerShell PowerShell
Vista Bus. version can't send ctrl-alt-del from gotomy pc Vista General
Ctrl-Alt-Delete / Ctrl-Shift-Esc--------Task Manager Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46