Runwait with Comspec and WritetoLog

Get help with using AutoHotkey and its commands and hotkeys
Peter2
Posts: 243
Joined: 21 Sep 2014, 14:38
Location: CH

Runwait with Comspec and WritetoLog

26 Jul 2019, 09:54

I have something like this to call my defined EXE with defined parameters in a loop

Code: Select all

RunWait, %ComSpec% /c color 16 && echo my job is running.... && "%main_exedatei%" "%Config%" 
Works fine, and waits(!!) fine with the next loop.

But when I add an output -option like this

Code: Select all

RunWait, %ComSpec% /c color 16 && echo my job is running.... && "%main_exedatei%" "%Config%" >> "mylog.txt"
then it does not wait - it fires both all commands of the loops without waiting.

Bug or feature?

Peter
Peter (AHK Beginner) / Win 7 x64, AHK Version v1.1.22.xx
tmplinshi
Posts: 1502
Joined: 01 Oct 2013, 14:57

Re: Runwait with Comspec and WritetoLog

26 Jul 2019, 11:14

Works fine:

Code: Select all

RunWait, %ComSpec% /c color 16 && echo my job is running.... && ping bing.com >> "ping.txt"
MsgBox bye
TAC109
Posts: 360
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Runwait with Comspec and WritetoLog

26 Jul 2019, 17:41

Enclose all the DOS commands in another set of double-quotes:-

Code: Select all

RunWait, %ComSpec% /c "color 16 && echo my job is running.... && "%main_exedatei%" "%Config%" >> "mylog.txt""
My programs:-
ReClip - a Text Reformatting and Clip Management utility
XRef - Produces Cross Reference lists for scripts
Peter2
Posts: 243
Joined: 21 Sep 2014, 14:38
Location: CH

Re: Runwait with Comspec and WritetoLog

29 Jul 2019, 03:25

TAC109 wrote:
26 Jul 2019, 17:41
Enclose all the DOS commands in another set of double-quotes:-....
Thanks, but it does not work.

Without the output-paraneter ">> d:\mylog.txt" it..
- starts the cmd-window
- sets the color
- starts the exe with the params
- it runs approx. 20 sec and brings some progress-messages to the window
- it closes the window

With the output-paraneter ">> d:\mylog.txt" it..
- starts the cmd-window
- sets the color
- starts the exe with the params
- it runs approx. 1 sec and says "Press any key to continue..."
- it writes ssome internal proframm messages to d:\mylog.txt
Last edited by Peter2 on 29 Jul 2019, 05:20, edited 1 time in total.
Peter (AHK Beginner) / Win 7 x64, AHK Version v1.1.22.xx
TAC109
Posts: 360
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Runwait with Comspec and WritetoLog

29 Jul 2019, 04:59

You mentioned c:\mylog.txt. Generally Windows does not allow files to be created in the root directory of c:. Try specifying your file in a suitable directory.
My programs:-
ReClip - a Text Reformatting and Clip Management utility
XRef - Produces Cross Reference lists for scripts
Peter2
Posts: 243
Joined: 21 Sep 2014, 14:38
Location: CH

Re: Runwait with Comspec and WritetoLog

29 Jul 2019, 05:19

TAC109 wrote:
29 Jul 2019, 04:59
You mentioned c:\mylog.txt. Generally Windows does not allow files to be created in the root directory of c:. Try specifying your file in a suitable directory.
My fault - I tried to write the example as simple as possible. I modified the posting above.
But the (not-)writing of the log is not the problem; it influences the "Runwait"-Behaviour.
Peter (AHK Beginner) / Win 7 x64, AHK Version v1.1.22.xx
TAC109
Posts: 360
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Runwait with Comspec and WritetoLog

29 Jul 2019, 17:06

You’ll need to reveal more of your code and the name of the program you are trying to run if you want more help from the forum.
My programs:-
ReClip - a Text Reformatting and Clip Management utility
XRef - Produces Cross Reference lists for scripts

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], Flipeador, Google [Bot], teadrinker, viceversa, yjs778 and 257 guests