Hottest Free Downloads - DownloadPipe.com Over 197,000 downloads! Bookmark Now!
DownloadPipe.com - New Downloads Every Minute
 SEARCH:
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Create a batch file?

 
   Windows (Home) -> Configuration Manage RSS
Next:  disconnected network drive - network drives.gif (..  
Author Message
Louise

External


Since: Nov 02, 2004
Posts: 17



(Msg. 1) Posted: Sat Jan 29, 2005 1:19 am
Post subject: Create a batch file?
Archived from groups: microsoft>public>windowsxp>configuration_manage (more info?)

I want to create a batch file, or a command file - I'm not sure what the
correct terminology is.

What I want to do is create an exe file which I can execute in windows
when I choose to. I would want this file to bring up two different
programs sequentially - waiting for the first to load its files before
bringing up the second.

Way back in the days of dos, you could do this with the dos command
copycon etc. But that's long gone and I'm wondering how to do it from
within Win XP - probably as an exe file.

TIA

Louise
Back to top
Login to vote
Thorsten Matzner

External


Since: Sep 22, 2004
Posts: 137



(Msg. 2) Posted: Sat Jan 29, 2005 7:26 pm
Post subject: Re: Create a batch file? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Louise <none.RemoveThis@nospam.com> wrote:

>I want to create a batch file, or a command file - I'm not sure what the
>correct terminology is.
>
>What I want to do is create an exe file which I can execute in windows
>when I choose to. I would want this file to bring up two different
>programs sequentially - waiting for the first to load its files before
>bringing up the second.

That is a batch file. At a DOS prompt type
START /?
for help with this issue.

--
(tm)
Back to top
Login to vote
Louise

External


Since: Nov 02, 2004
Posts: 17



(Msg. 3) Posted: Sun Jan 30, 2005 6:54 am
Post subject: Re: Create a batch file? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <#EWsMBjBFHA.2392@TK2MSFTNGP14.phx.gbl>, tmatzner.RemoveThis@gmx.net
says...
> Louise <none.RemoveThis@nospam.com> wrote:
>
> >I want to create a batch file, or a command file - I'm not sure what the
> >correct terminology is.
> >
> >What I want to do is create an exe file which I can execute in windows
> >when I choose to. I would want this file to bring up two different
> >programs sequentially - waiting for the first to load its files before
> >bringing up the second.
>
> That is a batch file. At a DOS prompt type
> START /?
> for help with this issue.
>
>
Thanks - it looks complicated. Is there a dumb-down version? I thought
I once remembered seeing a little program that created these for you and
you just "filled in the blanks" but I couldn't find it when I searched
for it now.

Louise
Back to top
Login to vote
Bob Dietz

External


Since: Jan 31, 2005
Posts: 7



(Msg. 4) Posted: Mon Jan 31, 2005 11:41 am
Post subject: Re: Create a batch file? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Louise wrote:
> In article <#EWsMBjBFHA.2392@TK2MSFTNGP14.phx.gbl>, tmatzner.TakeThisOut@gmx.net
> says...
>
>>Louise <none.TakeThisOut@nospam.com> wrote:
>>
>>
>>>I want to create a batch file, or a command file - I'm not sure what the
>>>correct terminology is.
>>>
>>>What I want to do is create an exe file which I can execute in windows
>>>when I choose to. I would want this file to bring up two different
>>>programs sequentially - waiting for the first to load its files before
>>>bringing up the second.
>>
>>That is a batch file. At a DOS prompt type
>>START /?
>>for help with this issue.
>>
>>
>
> Thanks - it looks complicated. Is there a dumb-down version? I thought
> I once remembered seeing a little program that created these for you and
> you just "filled in the blanks" but I couldn't find it when I searched
> for it now.
>
> Louise



None that I know of.
Can you describe what you want the batch file to do?

--
Bob Dietz
Back to top
Login to vote
Thorsten Matzner

External


Since: Sep 22, 2004
Posts: 137



(Msg. 5) Posted: Mon Jan 31, 2005 6:32 pm
Post subject: Re: Create a batch file? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Louise <none.TakeThisOut@nospam.com> wrote:

>Thanks - it looks complicated. Is there a dumb-down version?

Not that I know of. You can find some more help in Help & Support.

--
(tm)
Back to top
Login to vote
Not Me

External


Since: Feb 01, 2005
Posts: 1



(Msg. 6) Posted: Tue Feb 01, 2005 8:45 pm
Post subject: Re: Create a batch file? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I believe you may be thinking about Batchrun which you can get from
here: http://www.outertech.com/index.php?_charisma_page=downloads .
Gene

Louise wrote:
> In article <#EWsMBjBFHA.2392@TK2MSFTNGP14.phx.gbl>, tmatzner RemoveThis @gmx.net
> says...
>
>>Louise <none RemoveThis @nospam.com> wrote:
>>
>>
>>>I want to create a batch file, or a command file - I'm not sure what the
>>>correct terminology is.
>>>
>>>What I want to do is create an exe file which I can execute in windows
>>>when I choose to. I would want this file to bring up two different
>>>programs sequentially - waiting for the first to load its files before
>>>bringing up the second.
>>
>>That is a batch file. At a DOS prompt type
>>START /?
>>for help with this issue.
>>
>>
>
> Thanks - it looks complicated. Is there a dumb-down version? I thought
> I once remembered seeing a little program that created these for you and
> you just "filled in the blanks" but I couldn't find it when I searched
> for it now.
>
> Louise
Back to top
Login to vote
Louise

External


Since: Nov 02, 2004
Posts: 17



(Msg. 7) Posted: Wed Feb 02, 2005 4:57 am
Post subject: Re: Create a batch file? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <eJg0yw7BFHA.2260 RemoveThis @TK2MSFTNGP14.phx.gbl>, rbdietz_1999
@yahoo.com says...
> Louise wrote:
> > In article <#EWsMBjBFHA.2392@TK2MSFTNGP14.phx.gbl>, tmatzner RemoveThis @gmx.net
> > says...
> >
> >>Louise <none RemoveThis @nospam.com> wrote:
> >>
> >>
> >>>I want to create a batch file, or a command file - I'm not sure what the
> >>>correct terminology is.
> >>>
> >>>What I want to do is create an exe file which I can execute in windows
> >>>when I choose to. I would want this file to bring up two different
> >>>programs sequentially - waiting for the first to load its files before
> >>>bringing up the second.
> >>
> >>That is a batch file. At a DOS prompt type
> >>START /?
> >>for help with this issue.
> >>
> >>
> >
> > Thanks - it looks complicated. Is there a dumb-down version? I thought
> > I once remembered seeing a little program that created these for you and
> > you just "filled in the blanks" but I couldn't find it when I searched
> > for it now.
> >
> > Louise
>
>
>
> None that I know of.
> Can you describe what you want the batch file to do?
>
>
I want it to open a program: Dragon Naturally Speaking

Then I want it to wait about 45 seconds because Dragon has to load a
user file.

Then I want it to bring up the surround mixer which is one of the
utilities from my Soundblaster Audigy 2ZS

Then, if possible (and this is probably asking too much), I want it to
remove the X from the line in box on the surround mixer, thereby
activating the line-in for recording.

I find I do this step by step a few times a day and I would love to get
it automated.

Louise
Back to top
Login to vote
David Candy

External


Since: Jan 30, 2005
Posts: 122



(Msg. 8) Posted: Wed Feb 02, 2005 4:25 pm
Post subject: Re: Create a batch file? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Use script. You should also use AppActivate (to ensure keystrokes go where you expect) and possibley Sleep (depends on the relationship of sending and recieving programs). Copy line into a text file called whatever.vbs

set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.SendKeys "%{TAB}^c%{TAB}^v"

[above sends Alt + Tab, Ctrl + C, Alt + Tab, then Ctrl + V]

or

set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "calc"
WScript.Sleep 100
WshShell.AppActivate "Calculator"
WScript.Sleep 100
WshShell.SendKeys "1{+}"


Then set a shortcut to the scripts and set a hotkey for the shortcut (see help)


Windows Script Host

SendKeys Method
See Also
WshShell Object | Run Method

Sends one or more keystrokes to the active window (as if typed on the keyboard).

object.SendKeys(string)
Arguments
object
WshShell object.
string
String value indicating the keystroke(s) you want to send.
Remarks
Use the SendKeys method to send keystrokes to applications that have no automation interface. Most keyboard characters are represented by a single keystroke. Some keyboard characters are made up of combinations of keystrokes (CTRL+SHIFT+HOME, for example). To send a single keyboard character, send the character itself as the string argument. For example, to send the letter x, send the string argument "x".

Note To send a space, send the string " ".
You can use SendKeys to send more than one keystroke at a time. To do this, create a compound string argument that represents a sequence of keystrokes by appending each keystroke in the sequence to the one before it. For example, to send the keystrokes a, b, and c, you would send the string argument "abc". The SendKeys method uses some characters as modifiers of characters (instead of using their face-values). This set of special characters consists of parentheses, brackets, braces, and the:

a.. plus sign "+",
b.. caret "^",
c.. percent sign "%",
d.. and tilde "~"
Send these characters by enclosing them within braces "{}". For example, to send the plus sign, send the string argument "{+}". Brackets "[ ]" have no special meaning when used with SendKeys, but you must enclose them within braces to accommodate applications that do give them a special meaning (for dynamic data exchange (DDE) for example).

a.. To send bracket characters, send the string argument "{[}" for the left bracket and "{]}" for the right one.
b.. To send brace characters, send the string argument "{{}" for the left brace and "{}}" for the right one.
Some keystrokes do not generate characters (such as ENTER and TAB). Some keystrokes represent actions (such as BACKSPACE and BREAK). To send these kinds of keystrokes, send the arguments shown in the following table:

Key Argument
BACKSPACE {BACKSPACE}, {BS}, or {BKSP}
BREAK {BREAK}
CAPS LOCK {CAPSLOCK}
DEL or DELETE {DELETE} or {DEL}
DOWN ARROW {DOWN}
END {END}
ENTER {ENTER} or ~
ESC {ESC}
HELP {HELP}
HOME {HOME}
INS or INSERT {INSERT} or {INS}
LEFT ARROW {LEFT}
NUM LOCK {NUMLOCK}
PAGE DOWN {PGDN}
PAGE UP {PGUP}
PRINT SCREEN {PRTSC}
RIGHT ARROW {RIGHT}
SCROLL LOCK {SCROLLLOCK}
TAB {TAB}
UP ARROW {UP}
F1 {F1}
F2 {F2}
F3 {F3}
F4 {F4}
F5 {F5}
F6 {F6}
F7 {F7}
F8 {F8}
F9 {F9}
F10 {F10}
F11 {F11}
F12 {F12}
F13 {F13}
F14 {F14}
F15 {F15}
F16 {F16}

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 %

Note When used this way, these special characters are not enclosed within a set of braces.
To specify that a combination of SHIFT, CTRL, and ALT should be held down while several other keys are pressed, create a compound string argument with the modified keystrokes enclosed in parentheses. For example, to send the keystroke combination that specifies that the SHIFT key is held down while:

a.. e and c are pressed, send the string argument "+(ec)".
b.. e is pressed, followed by a lone c (with no SHIFT), send the string argument "+ec".
You can use the SendKeys method to send a pattern of keystrokes that consists of a single keystroke pressed several times in a row. To do this, create a compound string argument that specifies the keystroke you want to repeat, followed by the number of times you want it repeated. You do this using a compound string argument of the form {keystroke number}. For example, to send the letter "x" ten times, you would send the string argument "{x 10}". Be sure to include a space between keystroke and number.

Note The only keystroke pattern you can send is the kind that is comprised of a single keystroke pressed several times. For example, you can send "x" ten times, but you cannot do the same for "Ctrl+x".
Note You cannot send the PRINT SCREEN key {PRTSC} to an application.
Example
The following example demonstrates the use of a single .wsf file for two jobs in different script languages (VBScript and JScript). Each job runs the Windows calculator and sends it keystrokes to execute a simple calculation.

<package>
<job id="vbs">
<script language="VBScript">
set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "calc"
WScript.Sleep 100
WshShell.AppActivate "Calculator"
WScript.Sleep 100
WshShell.SendKeys "1{+}"
WScript.Sleep 500
WshShell.SendKeys "2"
WScript.Sleep 500
WshShell.SendKeys "~"
WScript.Sleep 500
WshShell.SendKeys "*3"
WScript.Sleep 500
WshShell.SendKeys "~"
WScript.Sleep 2500
</script>
</job>

<job id="js">
<script language="JScript">
var WshShell = WScript.CreateObject("WScript.Shell");
WshShell.Run("calc");
WScript.Sleep(100);
WshShell.AppActivate("Calculator");
WScript.Sleep(100);
WshShell.SendKeys ("1{+}");
WScript.Sleep(500);
WshShell.SendKeys("2");
WScript.Sleep(500);
WshShell.SendKeys("~");
WScript.Sleep(500);
WshShell.SendKeys("*3");
WScript.Sleep(500);
WshShell.SendKeys("~");
WScript.Sleep(2500);
</script>
</job>
</package>
See Also
WshShell Object | Run Method


--
----------------------------------------------------------
http://www.uscricket.com
"Louise" <none.DeleteThis@nospam.com> wrote in message news:MPG.1c6a296383ff66119897db@news-server.nyc.rr.com...
> In article <eJg0yw7BFHA.2260.DeleteThis@TK2MSFTNGP14.phx.gbl>, rbdietz_1999
> @yahoo.com says...
>> Louise wrote:
>> > In article <#EWsMBjBFHA.2392@TK2MSFTNGP14.phx.gbl>, tmatzner.DeleteThis@gmx.net
>> > says...
>> >
>> >>Louise <none.DeleteThis@nospam.com> wrote:
>> >>
>> >>
>> >>>I want to create a batch file, or a command file - I'm not sure what the
>> >>>correct terminology is.
>> >>>
>> >>>What I want to do is create an exe file which I can execute in windows
>> >>>when I choose to. I would want this file to bring up two different
>> >>>programs sequentially - waiting for the first to load its files before
>> >>>bringing up the second.
>> >>
>> >>That is a batch file. At a DOS prompt type
>> >>START /?
>> >>for help with this issue.
>> >>
>> >>
>> >
>> > Thanks - it looks complicated. Is there a dumb-down version? I thought
>> > I once remembered seeing a little program that created these for you and
>> > you just "filled in the blanks" but I couldn't find it when I searched
>> > for it now.
>> >
>> > Louise
>>
>>
>>
>> None that I know of.
>> Can you describe what you want the batch file to do?
>>
>>
> I want it to open a program: Dragon Naturally Speaking
>
> Then I want it to wait about 45 seconds because Dragon has to load a
> user file.
>
> Then I want it to bring up the surround mixer which is one of the
> utilities from my Soundblaster Audigy 2ZS
>
> Then, if possible (and this is probably asking too much), I want it to
> remove the X from the line in box on the surround mixer, thereby
> activating the line-in for recording.
>
> I find I do this step by step a few times a day and I would love to get
> it automated.
>
> Louise
Back to top
Login to vote
Modem Ani

External


Since: Feb 02, 2005
Posts: 10



(Msg. 9) Posted: Wed Feb 02, 2005 4:25 pm
Post subject: Re: Create a batch file? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I dabble in VB and found your post fascinating. Thanks for taking the time.

Modem Ani

"David Candy" <.> wrote in message
news:uZuxfeOCFHA.208@TK2MSFTNGP12.phx.gbl...
Use script. You should also use AppActivate (to ensure keystrokes go where
you expect) and possibley Sleep (depends on the relationship of sending and
recieving programs). Copy line into a text file called whatever.vbs

set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.SendKeys "%{TAB}^c%{TAB}^v"

[above sends Alt + Tab, Ctrl + C, Alt + Tab, then Ctrl + V]

or

set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "calc"
WScript.Sleep 100
WshShell.AppActivate "Calculator"
WScript.Sleep 100
WshShell.SendKeys "1{+}"


Then set a shortcut to the scripts and set a hotkey for the shortcut (see
help)


Windows Script Host

SendKeys Method
See Also
WshShell Object | Run Method

Sends one or more keystrokes to the active window (as if typed on the
keyboard).

object.SendKeys(string)
Arguments
object
WshShell object.
string
String value indicating the keystroke(s) you want to send.
Remarks
Use the SendKeys method to send keystrokes to applications that have no
automation interface. Most keyboard characters are represented by a single
keystroke. Some keyboard characters are made up of combinations of
keystrokes (CTRL+SHIFT+HOME, for example). To send a single keyboard
character, send the character itself as the string argument. For example, to
send the letter x, send the string argument "x".

Note To send a space, send the string " ".
You can use SendKeys to send more than one keystroke at a time. To do this,
create a compound string argument that represents a sequence of keystrokes
by appending each keystroke in the sequence to the one before it. For
example, to send the keystrokes a, b, and c, you would send the string
argument "abc". The SendKeys method uses some characters as modifiers of
characters (instead of using their face-values). This set of special
characters consists of parentheses, brackets, braces, and the:

a.. plus sign "+",
b.. caret "^",
c.. percent sign "%",
d.. and tilde "~"
Send these characters by enclosing them within braces "{}". For example, to
send the plus sign, send the string argument "{+}". Brackets "[ ]" have no
special meaning when used with SendKeys, but you must enclose them within
braces to accommodate applications that do give them a special meaning (for
dynamic data exchange (DDE) for example).

a.. To send bracket characters, send the string argument "{[}" for the
left bracket and "{]}" for the right one.
b.. To send brace characters, send the string argument "{{}" for the left
brace and "{}}" for the right one.
Some keystrokes do not generate characters (such as ENTER and TAB). Some
keystrokes represent actions (such as BACKSPACE and BREAK). To send these
kinds of keystrokes, send the arguments shown in the following table:

Key Argument
BACKSPACE {BACKSPACE}, {BS}, or {BKSP}
BREAK {BREAK}
CAPS LOCK {CAPSLOCK}
DEL or DELETE {DELETE} or {DEL}
DOWN ARROW {DOWN}
END {END}
ENTER {ENTER} or ~
ESC {ESC}
HELP {HELP}
HOME {HOME}
INS or INSERT {INSERT} or {INS}
LEFT ARROW {LEFT}
NUM LOCK {NUMLOCK}
PAGE DOWN {PGDN}
PAGE UP {PGUP}
PRINT SCREEN {PRTSC}
RIGHT ARROW {RIGHT}
SCROLL LOCK {SCROLLLOCK}
TAB {TAB}
UP ARROW {UP}
F1 {F1}
F2 {F2}
F3 {F3}
F4 {F4}
F5 {F5}
F6 {F6}
F7 {F7}
F8 {F8}
F9 {F9}
F10 {F10}
F11 {F11}
F12 {F12}
F13 {F13}
F14 {F14}
F15 {F15}
F16 {F16}

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 %

Note When used this way, these special characters are not enclosed
within a set of braces.
To specify that a combination of SHIFT, CTRL, and ALT should be held down
while several other keys are pressed, create a compound string argument with
the modified keystrokes enclosed in parentheses. For example, to send the
keystroke combination that specifies that the SHIFT key is held down while:

a.. e and c are pressed, send the string argument "+(ec)".
b.. e is pressed, followed by a lone c (with no SHIFT), send the string
argument "+ec".
You can use the SendKeys method to send a pattern of keystrokes that
consists of a single keystroke pressed several times in a row. To do this,
create a compound string argument that specifies the keystroke you want to
repeat, followed by the number of times you want it repeated. You do this
using a compound string argument of the form {keystroke number}. For
example, to send the letter "x" ten times, you would send the string
argument "{x 10}". Be sure to include a space between keystroke and number.

Note The only keystroke pattern you can send is the kind that is
comprised of a single keystroke pressed several times. For example, you can
send "x" ten times, but you cannot do the same for "Ctrl+x".
Note You cannot send the PRINT SCREEN key {PRTSC} to an application.
Example
The following example demonstrates the use of a single .wsf file for two
jobs in different script languages (VBScript and JScript). Each job runs the
Windows calculator and sends it keystrokes to execute a simple calculation.

<package>
<job id="vbs">
<script language="VBScript">
set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "calc"
WScript.Sleep 100
WshShell.AppActivate "Calculator"
WScript.Sleep 100
WshShell.SendKeys "1{+}"
WScript.Sleep 500
WshShell.SendKeys "2"
WScript.Sleep 500
WshShell.SendKeys "~"
WScript.Sleep 500
WshShell.SendKeys "*3"
WScript.Sleep 500
WshShell.SendKeys "~"
WScript.Sleep 2500
</script>
</job>

<job id="js">
<script language="JScript">
var WshShell = WScript.CreateObject("WScript.Shell");
WshShell.Run("calc");
WScript.Sleep(100);
WshShell.AppActivate("Calculator");
WScript.Sleep(100);
WshShell.SendKeys ("1{+}");
WScript.Sleep(500);
WshShell.SendKeys("2");
WScript.Sleep(500);
WshShell.SendKeys("~");
WScript.Sleep(500);
WshShell.SendKeys("*3");
WScript.Sleep(500);
WshShell.SendKeys("~");
WScript.Sleep(2500);
</script>
</job>
</package>
See Also
WshShell Object | Run Method


--
----------------------------------------------------------
http://www.uscricket.com
"Louise" <none.RemoveThis@nospam.com> wrote in message
news:MPG.1c6a296383ff66119897db@news-server.nyc.rr.com...
> In article <eJg0yw7BFHA.2260.RemoveThis@TK2MSFTNGP14.phx.gbl>, rbdietz_1999
> @yahoo.com says...
>> Louise wrote:
>> > In article <#EWsMBjBFHA.2392@TK2MSFTNGP14.phx.gbl>, tmatzner.RemoveThis@gmx.net
>> > says...
>> >
>> >>Louise <none.RemoveThis@nospam.com> wrote:
>> >>
>> >>
>> >>>I want to create a batch file, or a command file - I'm not sure what
>> >>>the
>> >>>correct terminology is.
>> >>>
>> >>>What I want to do is create an exe file which I can execute in windows
>> >>>when I choose to. I would want this file to bring up two different
>> >>>programs sequentially - waiting for the first to load its files before
>> >>>bringing up the second.
>> >>
>> >>That is a batch file. At a DOS prompt type
>> >>START /?
>> >>for help with this issue.
>> >>
>> >>
>> >
>> > Thanks - it looks complicated. Is there a dumb-down version? I
>> > thought
>> > I once remembered seeing a little program that created these for you
>> > and
>> > you just "filled in the blanks" but I couldn't find it when I searched
>> > for it now.
>> >
>> > Louise
>>
>>
>>
>> None that I know of.
>> Can you describe what you want the batch file to do?
>>
>>
> I want it to open a program: Dragon Naturally Speaking
>
> Then I want it to wait about 45 seconds because Dragon has to load a
> user file.
>
> Then I want it to bring up the surround mixer which is one of the
> utilities from my Soundblaster Audigy 2ZS
>
> Then, if possible (and this is probably asking too much), I want it to
> remove the X from the line in box on the surround mixer, thereby
> activating the line-in for recording.
>
> I find I do this step by step a few times a day and I would love to get
> it automated.
>
> Louise
Back to top
Login to vote
David Candy

External


Since: Jan 30, 2005
Posts: 122



(Msg. 10) Posted: Wed Feb 02, 2005 4:54 pm
Post subject: Re: Create a batch file? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I should just explain appactivate for louise. It is the titlebar text

WshShell.AppActivate "Calculator"

Calculator is what it shows in calc's titlebar.

I also suspect that one of the things she wishes to use is a system notification icon.
To move around the desktop toolbars, Taskbar, Notification Area and the Desktop - press Ctrl + Escape (or the Winkey) to activate Start, Escape to cancel the menu, then Tab and Shift + Tab to the various parts of the screen. Use the arrow keys to move within a section. Winkey + B jumps straight to the System Notification Area. To get a context menu of a blank part of the taskbar use the clock's context menu. Shift + F10 displays the context menu, Space or Enter activates.

--
----------------------------------------------------------
http://www.uscricket.com
"Modem Ani" <notquinoas.DeleteThis@notmyrealbox.com> wrote in message news:%23dKdfpOCFHA.904@TK2MSFTNGP12.phx.gbl...
>I dabble in VB and found your post fascinating. Thanks for taking the time.
>
> Modem Ani
>
> "David Candy" <.> wrote in message
> news:uZuxfeOCFHA.208@TK2MSFTNGP12.phx.gbl...
> Use script. You should also use AppActivate (to ensure keystrokes go where
> you expect) and possibley Sleep (depends on the relationship of sending and
> recieving programs). Copy line into a text file called whatever.vbs
>
> set WshShell = WScript.CreateObject("WScript.Shell")
> WshShell.SendKeys "%{TAB}^c%{TAB}^v"
>
> [above sends Alt + Tab, Ctrl + C, Alt + Tab, then Ctrl + V]
>
> or
>
> set WshShell = WScript.CreateObject("WScript.Shell")
> WshShell.Run "calc"
> WScript.Sleep 100
> WshShell.AppActivate "Calculator"
> WScript.Sleep 100
> WshShell.SendKeys "1{+}"
>
>
> Then set a shortcut to the scripts and set a hotkey for the shortcut (see
> help)
>
>
> Windows Script Host
>
> SendKeys Method
> See Also
> WshShell Object | Run Method
>
> Sends one or more keystrokes to the active window (as if typed on the
> keyboard).
>
> object.SendKeys(string)
> Arguments
> object
> WshShell object.
> string
> String value indicating the keystroke(s) you want to send.
> Remarks
> Use the SendKeys method to send keystrokes to applications that have no
> automation interface. Most keyboard characters are represented by a single
> keystroke. Some keyboard characters are made up of combinations of
> keystrokes (CTRL+SHIFT+HOME, for example). To send a single keyboard
> character, send the character itself as the string argument. For example, to
> send the letter x, send the string argument "x".
>
> Note To send a space, send the string " ".
> You can use SendKeys to send more than one keystroke at a time. To do this,
> create a compound string argument that represents a sequence of keystrokes
> by appending each keystroke in the sequence to the one before it. For
> example, to send the keystrokes a, b, and c, you would send the string
> argument "abc". The SendKeys method uses some characters as modifiers of
> characters (instead of using their face-values). This set of special
> characters consists of parentheses, brackets, braces, and the:
>
> a.. plus sign "+",
> b.. caret "^",
> c.. percent sign "%",
> d.. and tilde "~"
> Send these characters by enclosing them within braces "{}". For example, to
> send the plus sign, send the string argument "{+}". Brackets "[ ]" have no
> special meaning when used with SendKeys, but you must enclose them within
> braces to accommodate applications that do give them a special meaning (for
> dynamic data exchange (DDE) for example).
>
> a.. To send bracket characters, send the string argument "{[}" for the
> left bracket and "{]}" for the right one.
> b.. To send brace characters, send the string argument "{{}" for the left
> brace and "{}}" for the right one.
> Some keystrokes do not generate characters (such as ENTER and TAB). Some
> keystrokes represent actions (such as BACKSPACE and BREAK). To send these
> kinds of keystrokes, send the arguments shown in the following table:
>
> Key Argument
> BACKSPACE {BACKSPACE}, {BS}, or {BKSP}
> BREAK {BREAK}
> CAPS LOCK {CAPSLOCK}
> DEL or DELETE {DELETE} or {DEL}
> DOWN ARROW {DOWN}
> END {END}
> ENTER {ENTER} or ~
> ESC {ESC}
> HELP {HELP}
> HOME {HOME}
> INS or INSERT {INSERT} or {INS}
> LEFT ARROW {LEFT}
> NUM LOCK {NUMLOCK}
> PAGE DOWN {PGDN}
> PAGE UP {PGUP}
> PRINT SCREEN {PRTSC}
> RIGHT ARROW {RIGHT}
> SCROLL LOCK {SCROLLLOCK}
> TAB {TAB}
> UP ARROW {UP}
> F1 {F1}
> F2 {F2}
> F3 {F3}
> F4 {F4}
> F5 {F5}
> F6 {F6}
> F7 {F7}
> F8 {F8}
> F9 {F9}
> F10 {F10}
> F11 {F11}
> F12 {F12}
> F13 {F13}
> F14 {F14}
> F15 {F15}
> F16 {F16}
>
> 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 %
>
> Note When used this way, these special characters are not enclosed
> within a set of braces.
> To specify that a combination of SHIFT, CTRL, and ALT should be held down
> while several other keys are pressed, create a compound string argument with
> the modified keystrokes enclosed in parentheses. For example, to send the
> keystroke combination that specifies that the SHIFT key is held down while:
>
> a.. e and c are pressed, send the string argument "+(ec)".
> b.. e is pressed, followed by a lone c (with no SHIFT), send the string
> argument "+ec".
> You can use the SendKeys method to send a pattern of keystrokes that
> consists of a single keystroke pressed several times in a row. To do this,
> create a compound string argument that specifies the keystroke you want to
> repeat, followed by the number of times you want it repeated. You do this
> using a compound string argument of the form {keystroke number}. For
> example, to send the letter "x" ten times, you would send the string
> argument "{x 10}". Be sure to include a space between keystroke and number.
>
> Note The only keystroke pattern you can send is the kind that is
> comprised of a single keystroke pressed several times. For example, you can
> send "x" ten times, but you cannot do the same for "Ctrl+x".
> Note You cannot send the PRINT SCREEN key {PRTSC} to an application.
> Example
> The following example demonstrates the use of a single .wsf file for two
> jobs in different script languages (VBScript and JScript). Each job runs the
> Windows calculator and sends it keystrokes to execute a simple calculation.
>
> <package>
> <job id="vbs">
> <script language="VBScript">
> set WshShell = WScript.CreateObject("WScript.Shell")
> WshShell.Run "calc"
> WScript.Sleep 100
> WshShell.AppActivate "Calculator"
> WScript.Sleep 100
> WshShell.SendKeys "1{+}"
> WScript.Sleep 500
> WshShell.SendKeys "2"
> WScript.Sleep 500
> WshShell.SendKeys "~"
> WScript.Sleep 500
> WshShell.SendKeys "*3"
> WScript.Sleep 500
> WshShell.SendKeys "~"
> WScript.Sleep 2500
> </script>
> </job>
>
> <job id="js">
> <script language="JScript">
> var WshShell = WScript.CreateObject("WScript.Shell");
> WshShell.Run("calc");
> WScript.Sleep(100);
> WshShell.AppActivate("Calculator");
> WScript.Sleep(100);
> WshShell.SendKeys ("1{+}");
> WScript.Sleep(500);
> WshShell.SendKeys("2");
> WScript.Sleep(500);
> WshShell.SendKeys("~");
> WScript.Sleep(500);
> WshShell.SendKeys("*3");
> WScript.Sleep(500);
> WshShell.SendKeys("~");
> WScript.Sleep(2500);
> </script>
> </job>
> </package>
> See Also
> WshShell Object | Run Method
>
>
> --
> ----------------------------------------------------------
> http://www.uscricket.com
> "Louise" <none.DeleteThis@nospam.com> wrote in message
> news:MPG.1c6a296383ff66119897db@news-server.nyc.rr.com...
>> In article <eJg0yw7BFHA.2260.DeleteThis@TK2MSFTNGP14.phx.gbl>, rbdietz_1999
>> @yahoo.com says...
>>> Louise wrote:
>>> > In article <#EWsMBjBFHA.2392@TK2MSFTNGP14.phx.gbl>, tmatzner.DeleteThis@gmx.net
>>> > says...
>>> >
>>> >>Louise <none.DeleteThis@nospam.com> wrote:
>>> >>
>>> >>
>>> >>>I want to create a batch file, or a command file - I'm not sure what
>>> >>>the
>>> >>>correct terminology is.
>>> >>>
>>> >>>What I want to do is create an exe file which I can execute in windows
>>> >>>when I choose to. I would want this file to bring up two different
>>> >>>programs sequentially - waiting for the first to load its files before
>>> >>>bringing up the second.
>>> >>
>>> >>That is a batch file. At a DOS prompt type
>>> >>START /?
>>> >>for help with this issue.
>>> >>
>>> >>
>>> >
>>> > Thanks - it looks complicated. Is there a dumb-down version? I
>>> > thought
>>> > I once remembered seeing a little program that created these for you
>>> > and
>>> > you just "filled in the blanks" but I couldn't find it when I searched
>>> > for it now.
>>> >
>>> > Louise
>>>
>>>
>>>
>>> None that I know of.
>>> Can you describe what you want the batch file to do?
>>>
>>>
>> I want it to open a program: Dragon Naturally Speaking
>>
>> Then I want it to wait about 45 seconds because Dragon has to load a
>> user file.
>>
>> Then I want it to bring up the surround mixer which is one of the
>> utilities from my Soundblaster Audigy 2ZS
>>
>> Then, if possible (and this is probably asking too much), I want it to
>> remove the X from the line in box on the surround mixer, thereby
>> activating the line-in for recording.
>>
>> I find I do this step by step a few times a day and I would love to get
>> it automated.
>>
>> Louise
>
Back to top
Login to vote
Louise

External


Since: Nov 02, 2004
Posts: 17



(Msg. 11) Posted: Thu Feb 03, 2005 8:58 pm
Post subject: Re: Create a batch file? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <OilNzuOCFHA.1404.RemoveThis@TK2MSFTNGP11.phx.gbl>, "David Candy" <.>
says...
> I should just explain appactivate for louise. It is the titlebar text
>
> WshShell.AppActivate "Calculator"
>
> Calculator is what it shows in calc's titlebar.
>
> I also suspect that one of the things she wishes to use is a system =
> notification icon.=20
> To move around the desktop toolbars, Taskbar, Notification Area and the =
> Desktop - press Ctrl + Escape (or the Winkey) to activate Start, Escape =
> to cancel the menu, then Tab and Shift + Tab to the various parts of the =
> screen. Use the arrow keys to move within a section. Winkey + B jumps =
> straight to the System Notification Area. To get a context menu of a =
> blank part of the taskbar use the clock's context menu. Shift + F10 =
> displays the context menu, Space or Enter activates.
>
> --=20
> ----------------------------------------------------------
> http://www.uscricket.com
> "Modem Ani" <notquinoas.RemoveThis@notmyrealbox.com> wrote in message =
> news:%23dKdfpOCFHA.904@TK2MSFTNGP12.phx.gbl...
> >I dabble in VB and found your post fascinating. Thanks for taking the =
> time.
> >=20
> > Modem Ani
> >=20
> > "David Candy" <.> wrote in message=20
> > news:uZuxfeOCFHA.208@TK2MSFTNGP12.phx.gbl...
> > Use script. You should also use AppActivate (to ensure keystrokes go =
> where=20
> > you expect) and possibley Sleep (depends on the relationship of =
> sending and=20
> > recieving programs). Copy line into a text file called whatever.vbs
> >=20
> > set WshShell =3D WScript.CreateObject("WScript.Shell")
> > WshShell.SendKeys "%{TAB}^c%{TAB}^v"
> >=20
> > [above sends Alt + Tab, Ctrl + C, Alt + Tab, then Ctrl + V]
> >=20
> > or
> >=20
> > set WshShell =3D WScript.CreateObject("WScript.Shell")
> > WshShell.Run "calc"
> > WScript.Sleep 100
> > WshShell.AppActivate "Calculator"
> > WScript.Sleep 100
> > WshShell.SendKeys "1{+}"
> >=20
> >=20
> > Then set a shortcut to the scripts and set a hotkey for the shortcut =
Thanks so much - I will try....

Louise
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Indexes file - I ran Norton's "Disk DOctor" and "Win DOctor" I found out that I have a problem with my INDEXES File that the computer could not fix. The message I got was "Deleting index entry 00707403.qjq in index $130 of file 28176" ...

error in MSsysedit file - WOWEXE HAS CAUSED A GENERAL PROTECTION DEFAULT IN MSYSTEM=DLL.000A.00032

Swap File Location - I've added two hard drives configured as a single RAID drive. Currently my windows swap file is saved in a separate partition on my main drive. Is there any advantage or disadvantage to moving the swap file to the RAID drive (either on the dirve directly...

DirectX 9.0 "Cannot Copy File" - I recently upgraded my computer harware (new motherboard, processor, memory). I formatted hard drive and reinstalled windows XP SP1. I've installed Windows updates and drivers for my PC Hardware (video card, sound, etc.). When I go to install DirectX..

Windows has no Paging File - I had to reinstall XP from my CD and after reinstalling I got the error "Your system has no paging file or paging file is too small" I have 384mb memory I followed all the steps in the knowledge article 315270 but it did not work, I still g...
       Windows (Home) -> Configuration Manage All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum
Categories:
  Windows Forums
 Game Forums
 Linux Forums
 Mac Forums
 PDA Forums
 Mobile Forums
  Top  |  Store  |  RSS Feeds RSS  |  Data Feeds  |  Advertise  |  Submit  |  Bookmark  |  Newsletter  |  Contact