|
Post by dozer2014 on Apr 27, 2020 21:47:24 GMT
I can't understand why the following macro doesn't work. I consistently get the "default" A regardless of what I enter in the box.
1 | RUN ACTION | WAIT MILLISECONDS | 1000 * | * | Prompt for switched save types. Archive, Date, or Mirror with T: * | 2 | RUN ACTION | INPUT BOX | A = Robocopy with Archive Switch to DT2 or D = Robocopy with Date Switch to DT2 or M = Robocopy with Mirror Switch to DT2::Backup Mode Selection::%STRING1% 3 | IF | STRING VARIABLE | %STRING1% | IS | A | GOTO MACRO LINE | 7 4 | IF | STRING VARIABLE | %STRING1% | IS | D | GOTO MACRO LINE | 7 5 | IF | STRING VARIABLE | %STRING1% | IS | M | GOTO MACRO LINE | 7 6 | RUN ACTION | DEFINE STRING VARIABLE | %STRING1%::A * | 7 | RUN ACTION | WAIT MILLISECONDS | 1000 * | 8 | RUN ACTION | INPUT BOX | A = Robocopy with Archive Switch to My Cloud or D = Robocopy with Date Switch to My Cloud or M = Robocopy with Mirror Switch to My Cloud::Backup Mode Selection::%STRING2% 9 | IF | STRING VARIABLE | %STRING2% | IS | A | GOTO MACRO LINE | 13 10 | IF | STRING VARIABLE | %STRING2% | IS | D | GOTO MACRO LINE | 13 11 | IF | STRING VARIABLE | %STRING2% | IS | M | GOTO MACRO LINE | 13 12 | RUN ACTION | DEFINE STRING VARIABLE | %STRING2%::A * | * | Prompt for switched save types. Archive, Date, or Mirror with Z on the Cloud: * | 13 | RUN ACTION | RUN VIA CMD /c | C:\BATCH\DT1_Update_DT2.BAT - Shortcut 14 | 1400 | 250 | 5000 | Keypress C 15 | 1400 | 250 | 1000 | Keypress ENTER 16 | 1400 | 250 | 2000 | Keypress B 17 | 1400 | 250 | 1000 | Keypress ENTER 18 | 1400 | 250 | 2000 | Keypress Y 19 | 1400 | 250 | 1000 | Keypress ENTER 20 | 1400 | 250 | 2000 | Keypress %STRING1% 21 | 1400 | 250 | 1000 | Keypress ENTER 22 | 1400 | 250 | 2000 | Keypress Y 23 | 1400 | 250 | 1000 | Keypress ENTER 24 | 1400 | 250 | 2000 | Keypress C 25 | 1400 | 250 | 1000 | Keypress ENTER * | * | Make sure all following windows are closed before continuing. * | 26 | IF | WINDOW TITLE | My Batch | NOT EXIST | CONTINUE 27 | IF | WINDOW TITLE | C:\WINDOWS\system32\cmd.exe | NOT EXIST | CONTINUE * | 33 | RUN ACTION | WAIT MILLISECONDS | 15000 * | 29 | RUN ACTION | RUN VIA CMD /c | C:\BATCH\DT1_Update_DT2.BAT - Shortcut 30 | 1400 | 250 | 5000 | Keypress C 31 | 1400 | 250 | 1000 | Keypress ENTER 32 | 1400 | 250 | 2000 | Keypress E 33 | 1400 | 250 | 1000 | Keypress ENTER 34 | 1400 | 250 | 2000 | Keypress %STRING2% 35 | 1400 | 250 | 1000 | Keypress ENTER 36 | 1400 | 250 | 2000 | Keypress N 37 | 1400 | 250 | 1000 | Keypress ENTER 38 | 1400 | 250 | 2000 | Keypress N 39 | 1400 | 250 | 1000 | Keypress ENTER 40 | 1400 | 250 | 2000 | Keypress N 41 | 1400 | 250 | 1000 | Keypress ENTER 42 | 1400 | 250 | 2000 | Keypress N 43 | 1400 | 250 | 1000 | Keypress ENTER 44 | 1400 | 250 | 2000 | Keypress Y 45 | 1400 | 250 | 1000 | Keypress ENTER 46 | 1400 | 250 | 2000 | Keypress C 47 | 1400 | 250 | 1000 | Keypress ENTER * | * | Make sure all following windows are closed before continuing. * | 48 | IF | WINDOW TITLE | My Batch | NOT EXIST | CONTINUE 49 | IF | WINDOW TITLE | C:\WINDOWS\system32\cmd.exe | NOT EXIST | CONTINUE
|
|
|
Post by zeak on Apr 28, 2020 5:25:06 GMT
Hi Dozer2014,
Remove the % in front and behind your STRING1 and STRING2 on the action INPUT BOX
2 | RUN ACTION | INPUT BOX | A = Robocopy with Archive Switch to DT2 or D = Robocopy with Date Switch to DT2 or M = Robocopy with Mirror Switch to DT2::Backup Mode Selection::STRING1
8 | RUN ACTION | INPUT BOX | A = Robocopy with Archive Switch to My Cloud or D = Robocopy with Date Switch to My Cloud or M = Robocopy with Mirror Switch to My Cloud::Backup Mode Selection::STRING2
|
|
|
Post by dozer2014 on Apr 28, 2020 15:13:09 GMT
I tried that and got no change (which I find strange in itself). I type in an m for "mirror" and I get an a for "archive" on both of them. Probably something simple, but I have yet to find it.
|
|
|
Post by zeak on Apr 28, 2020 21:25:23 GMT
I tried that and got no change (which I find strange in itself). I type in an m for "mirror" and I get an a for "archive" on both of them. Probably something simple, but I have yet to find it. So I figured it out, Its because your IF String variable are looking for Capital A, D & M. It's case-sensitive, where i'm guessing you normally just press the key. I believe if you change your code to below it should work fine. 1 | RUN ACTION | WAIT MILLISECONDS | 1000 * | * | Prompt for switched save types. Archive, Date, or Mirror with T: * | 2 | RUN ACTION | INPUT BOX | A = Robocopy with Archive Switch to DT2 or D = Robocopy with Date Switch to DT2 or M = Robocopy with Mirror Switch to DT2::Backup Mode Selection::STRING1 3 | IF | STRING VARIABLE | %STRING1% | IS | a | GOTO MACRO LINE | 7 4 | IF | STRING VARIABLE | %STRING1% | IS | d | GOTO MACRO LINE | 7 5 | IF | STRING VARIABLE | %STRING1% | IS | m | GOTO MACRO LINE | 7 6 | RUN ACTION | DEFINE STRING VARIABLE | %STRING1%::A * | 7 | RUN ACTION | WAIT MILLISECONDS | 1000 * | 8 | RUN ACTION | INPUT BOX | A = Robocopy with Archive Switch to My Cloud or D = Robocopy with Date Switch to My Cloud or M = Robocopy with Mirror Switch to My Cloud::Backup Mode Selection::STRING2 9 | IF | STRING VARIABLE | %STRING2% | IS | a | GOTO MACRO LINE | 13 10 | IF | STRING VARIABLE | %STRING2% | IS | d | GOTO MACRO LINE | 13 11 | IF | STRING VARIABLE | %STRING2% | IS | m | GOTO MACRO LINE | 13 12 | RUN ACTION | DEFINE STRING VARIABLE | %STRING2%::A * | * | Prompt for switched save types. Archive, Date, or Mirror with Z on the Cloud: * | 13 | RUN ACTION | RUN VIA CMD /c | C:\BATCH\DT1_Update_DT2.BAT - Shortcut 14 | 1400 | 250 | 5000 | Keypress C 15 | 1400 | 250 | 1000 | Keypress ENTER 16 | 1400 | 250 | 2000 | Keypress B 17 | 1400 | 250 | 1000 | Keypress ENTER 18 | 1400 | 250 | 2000 | Keypress Y 19 | 1400 | 250 | 1000 | Keypress ENTER 20 | 1400 | 250 | 2000 | Keypress %STRING1% 21 | 1400 | 250 | 1000 | Keypress ENTER 22 | 1400 | 250 | 2000 | Keypress Y 23 | 1400 | 250 | 1000 | Keypress ENTER 24 | 1400 | 250 | 2000 | Keypress C 25 | 1400 | 250 | 1000 | Keypress ENTER * | * | Make sure all following windows are closed before continuing. * | 26 | IF | WINDOW TITLE | My Batch | NOT EXIST | CONTINUE 27 | IF | WINDOW TITLE | C:\WINDOWS\system32\cmd.exe | NOT EXIST | CONTINUE * | 33 | RUN ACTION | WAIT MILLISECONDS | 15000 * | 29 | RUN ACTION | RUN VIA CMD /c | C:\BATCH\DT1_Update_DT2.BAT - Shortcut 30 | 1400 | 250 | 5000 | Keypress C 31 | 1400 | 250 | 1000 | Keypress ENTER 32 | 1400 | 250 | 2000 | Keypress E 33 | 1400 | 250 | 1000 | Keypress ENTER 34 | 1400 | 250 | 2000 | Keypress %STRING2% 35 | 1400 | 250 | 1000 | Keypress ENTER 36 | 1400 | 250 | 2000 | Keypress N 37 | 1400 | 250 | 1000 | Keypress ENTER 38 | 1400 | 250 | 2000 | Keypress N 39 | 1400 | 250 | 1000 | Keypress ENTER 40 | 1400 | 250 | 2000 | Keypress N 41 | 1400 | 250 | 1000 | Keypress ENTER 42 | 1400 | 250 | 2000 | Keypress N 43 | 1400 | 250 | 1000 | Keypress ENTER 44 | 1400 | 250 | 2000 | Keypress Y 45 | 1400 | 250 | 1000 | Keypress ENTER 46 | 1400 | 250 | 2000 | Keypress C 47 | 1400 | 250 | 1000 | Keypress ENTER * | * | Make sure all following windows are closed before continuing. * | 48 | IF | WINDOW TITLE | My Batch | NOT EXIST | CONTINUE 49 | IF | WINDOW TITLE | C:\WINDOWS\system32\cmd.exe | NOT EXIST | CONTINUE
|
|
|
Post by dozer2014 on Apr 28, 2020 22:31:34 GMT
Tried that one and even put it in so it would test for both cases. When it reaches the point of the variable entry, instead of inserting the variable, it kicks it out of the batch job. The second batch job loads and runs when it's supposed to and does the same thing. Strange but true.................. It's not the batch job. It runs fine when I run it manually. The batch has the /i to test for both cases, but only those 3 characters. On that premise, the variable must be entering something that's causing the error. :sw1Again rem ECHO. SET /P sw1=Backup hard drive C: on DT1 to hard drive C: (T:) on DT2 with (A)rchive, (D)ate or (M)irror? (A, D or M): If /i %sw1%==A GOTO sw1Done If /i %sw1%==D GOTO sw1Done If /i %sw1%==M GOTO sw1Done ECHO. ECHO Wrong answer, (A, D or M) only. Try again............... ECHO. GOTO sw1Again rem :sw1Done
|
|
|
Post by zeak on Apr 29, 2020 4:29:53 GMT
To debug I used Event log to make sure it was doing what it was saying and then checked with Message box to see what was outputting to each string value.
|
|
|
Post by zeak on Apr 29, 2020 4:57:11 GMT
The batch has the /i to test for both cases, but only those 3 characters. On that premise, the variable must be entering something that's causing the error. From what I can understand you are saying is the Batch file is not case-sensitive, which is fine but what I am trying to say is the the IF statement in MMM IS case-sensitive and evaluates as FALSE if looking for Caps. So you need to have this: 3 | IF | STRING VARIABLE | %STRING1% | IS | d | GOTO MACRO LINE | 7 Instead of this: 3 | IF | STRING VARIABLE | %STRING1% | IS | D | GOTO MACRO LINE | 7
|
|
|
Post by Steve on Apr 29, 2020 9:58:51 GMT
STRING VARIABLE can take the 'CONTAINS -C' ( www.turnssoft.com/conditions.html#containsc) operator to check if the string does contain some characters. The '-C' removes any case sensitivity. 3 | IF | STRING VARIABLE | %STRING1% | CONTAINS -C | D | GOTO MACRO LINE | 7 Robocopy.exe takes me back to my windows admin days. A few years ago i wrote a GUI wrapper application for robocopy.exe - robocop robocopy ( www.turnssoft.com/robocop-robocopy.html). If you do a lot of robocoping and wouldnt mind monitoring robocopy job progress it might be worth a look.
|
|
|
Post by dozer2014 on Apr 29, 2020 10:18:00 GMT
Steve,
I have that GUI. I followed Zeek, but he didn't follow me. I knew what he meant with regard to the upper and lower case in the macro. I have changed the macro to the following. I also attached the event log.
1 | RUN ACTION | WAIT MILLISECONDS | 1000
* | Prompt for switched save types. Archive, Date, or Mirror with T:
2 | RUN ACTION | INPUT BOX | A = Robocopy with Archive Switch to DT2 or D = Robocopy with Date Switch to DT2 or M = Robocopy with Mirror Switch to DT2::Backup Mode Selection::STRING1
3 | IF | STRING VARIABLE | %STRING1% | IS | A | GOTO MACRO LINE | 10
4 | IF | STRING VARIABLE | %STRING1% | IS | D | GOTO MACRO LINE | 10
5 | IF | STRING VARIABLE | %STRING1% | IS | M | GOTO MACRO LINE | 10
6 | IF | STRING VARIABLE | %STRING1% | IS | a | GOTO MACRO LINE | 10
7 | IF | STRING VARIABLE | %STRING1% | IS | d | GOTO MACRO LINE | 10
8 | IF | STRING VARIABLE | %STRING1% | IS | m | GOTO MACRO LINE | 10
9 | RUN ACTION | DEFINE STRING VARIABLE | %STRING1%::A
10 | RUN ACTION | WAIT MILLISECONDS | 1000
11 | RUN ACTION | INPUT BOX | A = Robocopy with Archive Switch to My Cloud or D = Robocopy with Date Switch to My Cloud or M = Robocopy with Mirror Switch to My Cloud::Backup Mode Selection::STRING2
12 | IF | STRING VARIABLE | %STRING2% | IS | A | GOTO MACRO LINE | 19
13 | IF | STRING VARIABLE | %STRING2% | IS | D | GOTO MACRO LINE | 19
14 | IF | STRING VARIABLE | %STRING2% | IS | M | GOTO MACRO LINE | 19
15 | IF | STRING VARIABLE | %STRING2% | IS | a | GOTO MACRO LINE | 19
16 | IF | STRING VARIABLE | %STRING2% | IS | d | GOTO MACRO LINE | 19
17 | IF | STRING VARIABLE | %STRING2% | IS | m | GOTO MACRO LINE | 19
18 | RUN ACTION | DEFINE STRING VARIABLE | %STRING2%::A
* | Prompt for switched save types. Archive, Date, or Mirror with Z on the Cloud:
19 | RUN ACTION | RUN VIA CMD /c | C:\BATCH\DT1_Update_DT2.BAT - Shortcut
20 | 1400 | 250 | 5000 | Keypress C
21 | 1400 | 250 | 1000 | Keypress ENTER
22 | 1400 | 250 | 2000 | Keypress B
23 | 1400 | 250 | 1000 | Keypress ENTER
24 | 1400 | 250 | 2000 | Keypress Y
25 | 1400 | 250 | 1000 | Keypress ENTER
26 | 1400 | 250 | 2000 | Keypress %STRING1%
27 | 1400 | 250 | 1000 | Keypress ENTER
28 | 1400 | 250 | 2000 | Keypress Y
29 | 1400 | 250 | 1000 | Keypress ENTER
30 | 1400 | 250 | 2000 | Keypress E
31 | 1400 | 250 | 1000 | Keypress ENTER
* | Make sure all following windows are closed before continuing.
32 | IF | WINDOW TITLE | My Batch | NOT EXIST | CONTINUE
33 | IF | WINDOW TITLE | C:\WINDOWS\system32\cmd.exe | NOT EXIST | CONTINUE
34 | RUN ACTION | WAIT MILLISECONDS | 15000
35 | RUN ACTION | RUN VIA CMD /c | C:\BATCH\DT1_Update_DT2.BAT - Shortcut
36 | 1400 | 250 | 5000 | Keypress C
37 | 1400 | 250 | 1000 | Keypress ENTER
38 | 1400 | 250 | 2000 | Keypress E
39 | 1400 | 250 | 1000 | Keypress ENTER
40 | 1400 | 250 | 2000 | Keypress %STRING2%
41 | 1400 | 250 | 1000 | Keypress ENTER
42 | 1400 | 250 | 2000 | Keypress N
43 | 1400 | 250 | 1000 | Keypress ENTER
44 | 1400 | 250 | 2000 | Keypress N
45 | 1400 | 250 | 1000 | Keypress ENTER
46 | 1400 | 250 | 2000 | Keypress N
47 | 1400 | 250 | 1000 | Keypress ENTER
48 | 1400 | 250 | 2000 | Keypress N
49 | 1400 | 250 | 1000 | Keypress ENTER
50 | 1400 | 250 | 2000 | Keypress Y
51 | 1400 | 250 | 1000 | Keypress ENTER
52 | 1400 | 250 | 2000 | Keypress E
53 | 1400 | 250 | 1000 | Keypress ENTER
* | Make sure all following windows are closed before continuing.
54 | IF | WINDOW TITLE | My Batch | NOT EXIST | CONTINUE
55 | IF | WINDOW TITLE | C:\WINDOWS\system32\cmd.exe | NOT EXIST | CONTINUE
04/29/2020 04:01:40.63 AM : Starting macro playback
04/29/2020 04:01:40.64 AM : Macro condition: 1 | RUN ACTION | WAIT MILLISECONDS | 1000
04/29/2020 04:01:40.66 AM : Macro condition - Condition TRUE
04/29/2020 04:01:40.67 AM : Macro action - Thread sleeping for 1000 milliseconds
04/29/2020 04:01:41.63 AM : Macro condition: 2 | RUN ACTION | INPUT BOX | A = Robocopy with Archive Switch to DT2 or D = Robocopy with Date Switch to DT2 or M = Robocopy with Mirror Switch to DT2::Backup Mode Selection::STRING1
04/29/2020 04:01:41.64 AM : Macro condition - Condition TRUE
04/29/2020 04:01:41.66 AM : Macro action - Running ACTION: INPUT BOX
04/29/2020 04:01:47.63 AM : Macro action - Variable 'STRING1' auto corrected to '%STRING1%'
04/29/2020 04:01:47.64 AM : Macro action - InputBox (%STRING1%=m)
04/29/2020 04:01:47.66 AM : Macro condition: 3 | IF | STRING VARIABLE | %STRING1% | IS | A | GOTO MACRO LINE | 10
04/29/2020 04:01:47.67 AM : Macro condition - Condition FALSE
04/29/2020 04:01:47.69 AM : Macro condition: 4 | IF | STRING VARIABLE | %STRING1% | IS | D | GOTO MACRO LINE | 10
04/29/2020 04:01:47.70 AM : Macro condition - Condition FALSE
04/29/2020 04:01:47.72 AM : Macro condition: 5 | IF | STRING VARIABLE | %STRING1% | IS | M | GOTO MACRO LINE | 10
04/29/2020 04:01:47.74 AM : Macro condition - Condition FALSE
04/29/2020 04:01:47.75 AM : Macro condition: 6 | IF | STRING VARIABLE | %STRING1% | IS | a | GOTO MACRO LINE | 10
04/29/2020 04:01:47.77 AM : Macro condition - Condition FALSE
04/29/2020 04:01:47.78 AM : Macro condition: 7 | IF | STRING VARIABLE | %STRING1% | IS | d | GOTO MACRO LINE | 10
04/29/2020 04:01:47.80 AM : Macro condition - Condition FALSE
04/29/2020 04:01:47.81 AM : Macro condition: 8 | IF | STRING VARIABLE | %STRING1% | IS | m | GOTO MACRO LINE | 10
04/29/2020 04:01:47.83 AM : Macro condition - STRING m = m
04/29/2020 04:01:47.85 AM : Macro condition - Condition TRUE
04/29/2020 04:01:47.86 AM : Macro action - Running ACTION: GOTO MACRO LINE - Macro line(10)
04/29/2020 04:01:47.88 AM : Macro condition: 10 | RUN ACTION | WAIT MILLISECONDS | 1000
04/29/2020 04:01:47.89 AM : Macro condition - Condition TRUE
04/29/2020 04:01:47.91 AM : Macro action - Thread sleeping for 1000 milliseconds
04/29/2020 04:01:48.66 AM : Macro condition: 11 | RUN ACTION | INPUT BOX | A = Robocopy with Archive Switch to My Cloud or D = Robocopy with Date Switch to My Cloud or M = Robocopy with Mirror Switch to My Cloud::Backup Mode Selection::STRING2
04/29/2020 04:01:48.67 AM : Macro condition - Condition TRUE
04/29/2020 04:01:48.69 AM : Macro action - Running ACTION: INPUT BOX
04/29/2020 04:01:52.42 AM : Macro action - Variable 'STRING2' auto corrected to '%STRING2%'
04/29/2020 04:01:52.44 AM : Macro action - InputBox (%STRING2%=m)
04/29/2020 04:01:52.45 AM : Macro condition: 12 | IF | STRING VARIABLE | %STRING2% | IS | A | GOTO MACRO LINE | 19
04/29/2020 04:01:52.47 AM : Macro condition - Condition FALSE
04/29/2020 04:01:52.49 AM : Macro condition: 13 | IF | STRING VARIABLE | %STRING2% | IS | D | GOTO MACRO LINE | 19
04/29/2020 04:01:52.50 AM : Macro condition - Condition FALSE
04/29/2020 04:01:52.52 AM : Macro condition: 14 | IF | STRING VARIABLE | %STRING2% | IS | M | GOTO MACRO LINE | 19
04/29/2020 04:01:52.53 AM : Macro condition - Condition FALSE
04/29/2020 04:01:52.55 AM : Macro condition: 15 | IF | STRING VARIABLE | %STRING2% | IS | a | GOTO MACRO LINE | 19
04/29/2020 04:01:52.56 AM : Macro condition - Condition FALSE
04/29/2020 04:01:52.58 AM : Macro condition: 16 | IF | STRING VARIABLE | %STRING2% | IS | d | GOTO MACRO LINE | 19
04/29/2020 04:01:52.59 AM : Macro condition - Condition FALSE
04/29/2020 04:01:52.61 AM : Macro condition: 17 | IF | STRING VARIABLE | %STRING2% | IS | m | GOTO MACRO LINE | 19
04/29/2020 04:01:52.63 AM : Macro condition - STRING m = m
04/29/2020 04:01:52.64 AM : Macro condition - Condition TRUE
04/29/2020 04:01:52.66 AM : Macro action - Running ACTION: GOTO MACRO LINE - Macro line(19)
04/29/2020 04:01:52.67 AM : Macro condition: 19 | RUN ACTION | RUN VIA CMD /c | C:\BATCH\DT1_Update_DT2.BAT - Shortcut
04/29/2020 04:01:52.69 AM : Macro condition - Condition TRUE
04/29/2020 04:01:52.70 AM : Macro action - Running ACTION: RUN VIA CMD /c - CMD /C C:\BATCH\DT1_Update_DT2.BAT - Shortcut
04/29/2020 04:01:52.72 AM : Macro event: 20 | 1400 | 250 | 5000 | Keypress C
04/29/2020 04:01:57.56 AM : Macro event: 21 | 1400 | 250 | 1000 | Keypress ENTER
04/29/2020 04:01:58.61 AM : Macro event: 22 | 1400 | 250 | 2000 | Keypress B
04/29/2020 04:02:00.69 AM : Macro event: 23 | 1400 | 250 | 1000 | Keypress ENTER
04/29/2020 04:02:01.73 AM : Macro event: 24 | 1400 | 250 | 2000 | Keypress Y
04/29/2020 04:02:03.81 AM : Macro event: 25 | 1400 | 250 | 1000 | Keypress ENTER
04/29/2020 04:02:04.86 AM : Macro event: 26 | 1400 | 250 | 2000 | Keypress
04/29/2020 04:02:06.87 AM : Macro event: 27 | 1400 | 250 | 1000 | Keypress ENTER
04/29/2020 04:02:07.92 AM : Macro event: 28 | 1400 | 250 | 2000 | Keypress Y
04/29/2020 04:02:10.00 AM : Macro event: 29 | 1400 | 250 | 1000 | Keypress ENTER
04/29/2020 04:02:11.06 AM : Macro event: 30 | 1400 | 250 | 2000 | Keypress E
04/29/2020 04:02:13.14 AM : Macro event: 31 | 1400 | 250 | 1000 | Keypress ENTER
04/29/2020 04:02:14.19 AM : Macro condition: 32 | IF | WINDOW TITLE | My Batch | NOT EXIST | CONTINUE
04/29/2020 04:02:14.21 AM : Macro condition - Window Title: MY BATCH NOT EXIST
04/29/2020 04:02:14.23 AM : Macro condition - Condition TRUE
04/29/2020 04:02:14.25 AM : Macro action - Running ACTION: CONTINUE
04/29/2020 04:02:14.27 AM : Macro condition: 33 | IF | WINDOW TITLE | C:\WINDOWS\system32\cmd.exe | NOT EXIST | CONTINUE
04/29/2020 04:02:14.29 AM : Macro condition - Window Title: C:\WINDOWS\SYSTEM32\CMD.EXE NOT EXIST
04/29/2020 04:02:14.31 AM : Macro condition - Condition TRUE
04/29/2020 04:02:14.33 AM : Macro action - Running ACTION: CONTINUE
04/29/2020 04:02:14.35 AM : Macro condition: 34 | RUN ACTION | WAIT MILLISECONDS | 15000
04/29/2020 04:02:14.37 AM : Macro condition - Condition TRUE
04/29/2020 04:02:14.38 AM : Macro action - Thread sleeping for 15000 milliseconds
04/29/2020 04:02:29.20 AM : Macro condition: 35 | RUN ACTION | RUN VIA CMD /c | C:\BATCH\DT1_Update_DT2.BAT - Shortcut
04/29/2020 04:02:29.22 AM : Macro condition - Condition TRUE
04/29/2020 04:02:29.23 AM : Macro action - Running ACTION: RUN VIA CMD /c - CMD /C C:\BATCH\DT1_Update_DT2.BAT - Shortcut
04/29/2020 04:02:29.25 AM : Macro event: 36 | 1400 | 250 | 5000 | Keypress C
04/29/2020 04:02:34.30 AM : Macro event: 37 | 1400 | 250 | 1000 | Keypress ENTER
04/29/2020 04:02:35.34 AM : Macro event: 38 | 1400 | 250 | 2000 | Keypress E
04/29/2020 04:02:37.42 AM : Macro event: 39 | 1400 | 250 | 1000 | Keypress ENTER
04/29/2020 04:02:38.47 AM : Macro event: 40 | 1400 | 250 | 2000 | Keypress
04/29/2020 04:02:40.48 AM : Macro event: 41 | 1400 | 250 | 1000 | Keypress ENTER
04/29/2020 04:02:41.53 AM : Macro event: 42 | 1400 | 250 | 2000 | Keypress N
04/29/2020 04:02:43.61 AM : Macro event: 43 | 1400 | 250 | 1000 | Keypress ENTER
04/29/2020 04:02:44.65 AM : Macro event: 44 | 1400 | 250 | 2000 | Keypress N
04/29/2020 04:02:46.73 AM : Macro event: 45 | 1400 | 250 | 1000 | Keypress ENTER
04/29/2020 04:02:47.78 AM : Macro event: 46 | 1400 | 250 | 2000 | Keypress N
04/29/2020 04:02:49.86 AM : Macro event: 47 | 1400 | 250 | 1000 | Keypress ENTER
04/29/2020 04:02:50.90 AM : Macro event: 48 | 1400 | 250 | 2000 | Keypress N
04/29/2020 04:02:52.98 AM : Macro event: 49 | 1400 | 250 | 1000 | Keypress ENTER
04/29/2020 04:02:54.03 AM : Macro event: 50 | 1400 | 250 | 2000 | Keypress Y
04/29/2020 04:02:56.11 AM : Macro event: 51 | 1400 | 250 | 1000 | Keypress ENTER
04/29/2020 04:02:57.15 AM : Macro event: 52 | 1400 | 250 | 2000 | Keypress E
04/29/2020 04:02:59.23 AM : Macro event: 53 | 1400 | 250 | 1000 | Keypress ENTER
04/29/2020 04:03:00.28 AM : Macro condition: 54 | IF | WINDOW TITLE | My Batch | NOT EXIST | CONTINUE
04/29/2020 04:03:00.29 AM : Macro condition - Window Title: MY BATCH NOT EXIST
04/29/2020 04:03:00.31 AM : Macro condition - Condition TRUE
04/29/2020 04:03:00.32 AM : Macro action - Running ACTION: CONTINUE
04/29/2020 04:03:00.34 AM : Macro condition: 55 | IF | WINDOW TITLE | C:\WINDOWS\system32\cmd.exe | NOT EXIST | CONTINUE
04/29/2020 04:03:00.36 AM : Macro condition - Window Title: C:\WINDOWS\SYSTEM32\CMD.EXE NOT EXIST
04/29/2020 04:03:00.37 AM : Macro condition - Condition TRUE
04/29/2020 04:03:00.39 AM : Macro action - Running ACTION: CONTINUE
04/29/2020 04:03:00.40 AM : Macro playback finished
I'll make the change you suggested with the -C and try it again. You'll notice that where the variable should be, it's blank.
|
|
|
Post by dozer2014 on Apr 29, 2020 10:37:48 GMT
Steve, Changed it to the -C as suggested and that part worked fine. Still get a blank where the input character should be. I've been "playing" with BATCH since 286 days.
|
|
|
Post by zeak on Apr 29, 2020 22:21:21 GMT
I have that GUI. I followed Zeek, but he didn't follow me. I knew what he meant with regard to the upper and lower case in the macro. I have changed the macro to the following. I also attached the event log. Hi Dozer2014, Sorry I'm not familiar with RoboCopy and I don't use batch files very often, from what I could test by commenting out the CMD line and the 15 second wait time. The rest of the macro works fine. I would like to help more but this is out of my expertise, I'm sure Steve will be keen to help. My last test using Notepad instead of Batch.
|
|
|
Post by dozer2014 on Apr 29, 2020 23:39:44 GMT
Thanks zeak, I certainly don't know everything either. There was a day when I knew just about everything there was to know about a computer. I've even written extensive memory diagnostics in machine language. That was about 40 years ago now. Before PC's
I have a very extensive batch program I've built over the years. It's currently about 32 interconnecting batch files and almost takes up a MB. It keeps 2 machines virtually identical for backup purposes. I've used MMM to automate a lot of it's main functions. I updated the whole thing from xcopy to robocopy about 4 years ago. Steve will know what that is.
I find it interesting that it's working in your Notepad demo and not in the DOS window.
I still like playing with this stuff, but I'll never be as anal as a computer...................................
|
|
|
Post by Steve on Apr 30, 2020 22:23:16 GMT
zeak nice demo! Whats that tool your using to get the key presses to display on the screen?
|
|
|
Post by Steve on Apr 30, 2020 23:10:11 GMT
Thanks zeak, I certainly don't know everything either. There was a day when I knew just about everything there was to know about a computer. I've even written extensive memory diagnostics in machine language. That was about 40 years ago now. Before PC's I have a very extensive batch program I've built over the years. It's currently about 32 interconnecting batch files and almost takes up a MB. It keeps 2 machines virtually identical for backup purposes. I've used MMM to automate a lot of it's main functions. I updated the whole thing from xcopy to robocopy about 4 years ago. Steve will know what that is. I find it interesting that it's working in your Notepad demo and not in the DOS window. I still like playing with this stuff, but I'll never be as anal as a computer................................... That's some heavy batching! dozer2014 I'm not sure why your cmd /c actions aren't working as you expect them to. I've put together a little test that highlights some the usage for input box. I put some batch file logic in there too 1 | RUN ACTION | INPUT BOX | Enter GREEN or RED::Select Green or Red::STRING1 2 | RUN ACTION | INPUT BOX | Enter the counter value:::count = ::INTEGER 2 | RUN ACTION | DEFINE STRING VARIABLE | %STRING%::textoutput_%STRING1%.bat %INTEGER% 3 | RUN ACTION | RUN VIA CMD /c | D:\macro\test\%STRING% 4 | RUN ACTION | INPUT BOX | Run Again?::Y/N::PROMPT_YES_NO::BOOLEAN 5 | IF | BOOLEAN VARIABLE | %BOOLEAN% | IS TRUE | GOTO MACRO LINE | 1 6 | RUN ACTION | INPUT BOX | Type the word 'HELLO'::hello::STRING 7 | IF | STRING VARIABLE | %STRING% | CONTAINS -C | hello | MESSAGE PROMPT | You entered %string% - it does contain the word hello::Hello::0 | ELSE | 7 | RUN ACTION | MESSAGE PROMPT | You entered %string% - It DOES NOT contain the word hello::NO hello::0 textoutput_green.bat@echo off :head color A0 set intI=0 set intT=%1
:MAIN set /A intI+=1 cls echo [%intI%/%intT%] %date% %time% if /I "%intI%" EQU "%intT%" (GOTO END) ping -n 1 127.0.0.1>nul GOTO MAIN
:END color 0b echo "-----------------------" echo "------End of file------" ping -n 2 127.0.0.1>nul textoutput_red.bat@echo off :head color 4f set intI=0 set intT=%1
:MAIN set /A intI+=1 cls echo [%intI%/%intT%] %date% %time% if /I "%intI%" EQU "%intT%" (GOTO END) ping -n 1 127.0.0.1>nul GOTO MAIN
:END color 0b echo "-----------------------" echo "------End of file------" ping -n 2 127.0.0.1>nul
|
|
|
Post by zeak on Apr 30, 2020 23:31:19 GMT
zeak nice demo! Whats that tool your using to get the key presses to display on the screen? It's called Carnac, I downloaded it from code52.org/carnac/But I was a bit hesitant downloading and using it, as the website is not secure and I wasn't sure if the file had any viruses. I ran multiple virus check software on the file and came up with nothing, maybe you could have a look at it with some of your software.
|
|
|
Post by Steve on Apr 30, 2020 23:59:48 GMT
|
|
|
Post by dozer2014 on May 1, 2020 0:22:06 GMT
Appreciate your time. That was my first attempt at programming a variable into MMM. Seems to me lie it should work. Has to be a reason or just find another way to do it. While your here, I have another one I haven't checked out yet. I had to go back to the previous 7.3.0.0 version of MMM because something didn't work with the new one. I could probably change it to work, but I can't upgrade until I resolve it. I'm not even sure how to explain it right now.
|
|
|
Post by zeak on May 1, 2020 0:39:45 GMT
It would be nice if I knew how to unpack the file, remove the virus and recomple into a good program again. But unfortunately i'm not that skilled at programming.
|
|
|
Post by Steve on May 1, 2020 0:45:41 GMT
It would be nice if I knew how to unpack the file, remove the virus and recompile into a good program again. But unfortunately i'm not that skilled at programming. Well it could be just virus total engines hitting on something that is not malicious. Most of the engines detect nothing for this report detect nothing. The source for the project is available github.com/Code52/carnac so that's a good sign that the developer is not willingly packing malicious content.
|
|
|
Post by dozer2014 on May 1, 2020 0:59:18 GMT
Interesting.......................... If I put the % back on the variable for the inbox it types the default "A" instead of being blank.
04/30/2020 06:46:27.46 PM : Macro list cleared
04/30/2020 06:46:27.47 PM : Macro quick launch: C:\MYFILES\MMM\Test.mmmacro
04/30/2020 06:46:27.49 PM : Starting macro playback
04/30/2020 06:46:27.50 PM : Macro condition: 1 | RUN ACTION | WAIT MILLISECONDS | 1000
04/30/2020 06:46:27.52 PM : Macro condition - Condition TRUE
04/30/2020 06:46:27.54 PM : Macro action - Thread sleeping for 1000 milliseconds
04/30/2020 06:46:28.47 PM : Macro condition: 2 | RUN ACTION | INPUT BOX | A = Robocopy with Archive Switch to DT2 or D = Robocopy with Date Switch to DT2 or M = Robocopy with Mirror Switch to DT2::Backup Mode Selection::%STRING1%
04/30/2020 06:46:28.49 PM : Macro condition - Condition TRUE
04/30/2020 06:46:28.50 PM : Macro action - Running ACTION: INPUT BOX
04/30/2020 06:46:31.08 PM : Playback error: 2 | RUN ACTION | INPUT BOX | A = Robocopy with Archive Switch to DT2 or D = Robocopy with Date Switch to DT2 or M = Robocopy with Mirror Switch to DT2::Backup Mode Selection::%STRING1% - Condition execution error: Index was outside the bounds of the array.
04/30/2020 06:46:31.10 PM : Macro condition: 3 | IF | STRING VARIABLE | %STRING1% | CONTAINS -C | A | GOTO MACRO LINE | 7
04/30/2020 06:46:31.14 PM : Playback error: 3 | IF | STRING VARIABLE | %STRING1% | CONTAINS -C | A | GOTO MACRO LINE | 7 - Condition execution error [Unexpected Internal Error]: Object reference not set to an instance of an object.
04/30/2020 06:46:31.16 PM : Macro condition: 4 | IF | STRING VARIABLE | %STRING1% | CONTAINS -C | D | GOTO MACRO LINE | 7
04/30/2020 06:46:31.18 PM : Playback error: 4 | IF | STRING VARIABLE | %STRING1% | CONTAINS -C | D | GOTO MACRO LINE | 7 - Condition execution error [Unexpected Internal Error]: Object reference not set to an instance of an object.
04/30/2020 06:46:31.19 PM : Macro condition: 5 | IF | STRING VARIABLE | %STRING1% | CONTAINS -C | M | GOTO MACRO LINE | 7
04/30/2020 06:46:31.21 PM : Playback error: 5 | IF | STRING VARIABLE | %STRING1% | CONTAINS -C | M | GOTO MACRO LINE | 7 - Condition execution error [Unexpected Internal Error]: Object reference not set to an instance of an object.
04/30/2020 06:46:31.22 PM : Macro condition: 6 | RUN ACTION | DEFINE STRING VARIABLE | %STRING1%::A
04/30/2020 06:46:31.24 PM : Macro condition - Condition TRUE
04/30/2020 06:46:31.25 PM : Macro action - Variable (%STRING1% = A)
04/30/2020 06:46:31.27 PM : Macro condition: 7 | RUN ACTION | WAIT MILLISECONDS | 1000
04/30/2020 06:46:31.29 PM : Macro condition - Condition TRUE
04/30/2020 06:46:31.30 PM : Macro action - Thread sleeping for 1000 milliseconds
04/30/2020 06:46:32.16 PM : Macro condition: 8 | RUN ACTION | INPUT BOX | A = Robocopy with Archive Switch to My Cloud or D = Robocopy with Date Switch to My Cloud or M = Robocopy with Mirror Switch to My Cloud::Backup Mode Selection::%STRING2%
04/30/2020 06:46:32.18 PM : Macro condition - Condition TRUE
04/30/2020 06:46:32.19 PM : Macro action - Running ACTION: INPUT BOX
04/30/2020 06:46:34.68 PM : Playback error: 8 | RUN ACTION | INPUT BOX | A = Robocopy with Archive Switch to My Cloud or D = Robocopy with Date Switch to My Cloud or M = Robocopy with Mirror Switch to My Cloud::Backup Mode Selection::%STRING2% - Condition execution error: Index was outside the bounds of the array.
04/30/2020 06:46:34.69 PM : Macro condition: 9 | IF | STRING VARIABLE | %STRING2% | CONTAINS -C | A | GOTO MACRO LINE | 13
04/30/2020 06:46:34.71 PM : Playback error: 9 | IF | STRING VARIABLE | %STRING2% | CONTAINS -C | A | GOTO MACRO LINE | 13 - Condition execution error [Unexpected Internal Error]: Object reference not set to an instance of an object.
04/30/2020 06:46:34.72 PM : Macro condition: 10 | IF | STRING VARIABLE | %STRING2% | CONTAINS -C | D | GOTO MACRO LINE | 13
04/30/2020 06:46:34.74 PM : Playback error: 10 | IF | STRING VARIABLE | %STRING2% | CONTAINS -C | D | GOTO MACRO LINE | 13 - Condition execution error [Unexpected Internal Error]: Object reference not set to an instance of an object.
04/30/2020 06:46:34.75 PM : Macro condition: 11 | IF | STRING VARIABLE | %STRING2% | CONTAINS -C | M | GOTO MACRO LINE | 13
04/30/2020 06:46:34.77 PM : Playback error: 11 | IF | STRING VARIABLE | %STRING2% | CONTAINS -C | M | GOTO MACRO LINE | 13 - Condition execution error [Unexpected Internal Error]: Object reference not set to an instance of an object.
04/30/2020 06:46:34.78 PM : Macro condition: 12 | RUN ACTION | DEFINE STRING VARIABLE | %STRING2%::A
04/30/2020 06:46:34.80 PM : Macro condition - Condition TRUE
04/30/2020 06:46:34.82 PM : Macro action - Variable (%STRING2% = A)
04/30/2020 06:46:34.83 PM : Macro condition: 13 | RUN ACTION | RUN VIA CMD /c | C:\BATCH\DT1_Update_DT2.BAT - Shortcut
04/30/2020 06:46:34.85 PM : Macro condition - Condition TRUE
04/30/2020 06:46:34.86 PM : Macro action - Running ACTION: RUN VIA CMD /c - CMD /C C:\BATCH\DT1_Update_DT2.BAT - Shortcut
04/30/2020 06:46:34.88 PM : Macro event: 14 | 1400 | 250 | 5000 | Keypress C
04/30/2020 06:46:39.78 PM : Macro event: 15 | 1400 | 250 | 1000 | Keypress ENTER
04/30/2020 06:46:40.83 PM : Macro event: 16 | 1400 | 250 | 2000 | Keypress B
04/30/2020 06:46:42.91 PM : Macro event: 17 | 1400 | 250 | 1000 | Keypress ENTER
04/30/2020 06:46:43.96 PM : Macro event: 18 | 1400 | 250 | 2000 | Keypress Y
04/30/2020 06:46:46.03 PM : Macro event: 19 | 1400 | 250 | 1000 | Keypress ENTER
04/30/2020 06:46:47.08 PM : Macro event: 20 | 1400 | 250 | 2000 | Keypress A
04/30/2020 06:46:49.16 PM : Macro event: 21 | 1400 | 250 | 1000 | Keypress ENTER
04/30/2020 06:46:50.21 PM : Macro event: 22 | 1400 | 250 | 2000 | Keypress Y
04/30/2020 06:46:52.28 PM : Macro event: 23 | 1400 | 250 | 1000 | Keypress ENTER
04/30/2020 06:46:53.33 PM : Macro event: 24 | 1400 | 250 | 2000 | Keypress E
04/30/2020 06:46:55.41 PM : Macro event: 25 | 1400 | 250 | 1000 | Keypress ENTER
04/30/2020 06:46:56.46 PM : Macro condition: 26 | IF | WINDOW TITLE | My Batch | NOT EXIST | CONTINUE
04/30/2020 06:46:56.47 PM : Macro condition - Window Title: MY BATCH NOT EXIST
04/30/2020 06:46:56.49 PM : Macro condition - Condition TRUE
04/30/2020 06:46:56.50 PM : Macro action - Running ACTION: CONTINUE
04/30/2020 06:46:56.52 PM : Macro condition: 27 | IF | WINDOW TITLE | C:\WINDOWS\system32\cmd.exe | NOT EXIST | CONTINUE
04/30/2020 06:46:56.53 PM : Macro condition - Window Title: C:\WINDOWS\SYSTEM32\CMD.EXE NOT EXIST
04/30/2020 06:46:56.55 PM : Macro condition - Condition TRUE
04/30/2020 06:46:56.56 PM : Macro action - Running ACTION: CONTINUE
04/30/2020 06:46:56.58 PM : Macro condition: 28 | RUN ACTION | WAIT MILLISECONDS | 15000
04/30/2020 06:46:56.60 PM : Macro condition - Condition TRUE
04/30/2020 06:46:56.61 PM : Macro action - Thread sleeping for 15000 milliseconds
04/30/2020 06:47:11.47 PM : Macro condition: 29 | RUN ACTION | RUN VIA CMD /c | C:\BATCH\DT1_Update_DT2.BAT - Shortcut
04/30/2020 06:47:11.49 PM : Macro condition - Condition TRUE
04/30/2020 06:47:11.50 PM : Macro action - Running ACTION: RUN VIA CMD /c - CMD /C C:\BATCH\DT1_Update_DT2.BAT - Shortcut
04/30/2020 06:47:11.52 PM : Macro event: 30 | 1400 | 250 | 5000 | Keypress C
04/30/2020 06:47:16.56 PM : Macro event: 31 | 1400 | 250 | 1000 | Keypress ENTER
04/30/2020 06:47:17.61 PM : Macro event: 32 | 1400 | 250 | 2000 | Keypress E
04/30/2020 06:47:19.69 PM : Macro event: 33 | 1400 | 250 | 1000 | Keypress ENTER
04/30/2020 06:47:20.73 PM : Macro event: 34 | 1400 | 250 | 2000 | Keypress A
04/30/2020 06:47:22.81 PM : Macro event: 35 | 1400 | 250 | 1000 | Keypress ENTER
04/30/2020 06:47:23.86 PM : Macro event: 36 | 1400 | 250 | 2000 | Keypress N
04/30/2020 06:47:25.94 PM : Macro event: 37 | 1400 | 250 | 1000 | Keypress ENTER
04/30/2020 06:47:26.98 PM : Macro event: 38 | 1400 | 250 | 2000 | Keypress N
04/30/2020 06:47:29.06 PM : Macro event: 39 | 1400 | 250 | 1000 | Keypress ENTER
04/30/2020 06:47:30.11 PM : Macro event: 40 | 1400 | 250 | 2000 | Keypress N
04/30/2020 06:47:32.19 PM : Macro event: 41 | 1400 | 250 | 1000 | Keypress ENTER
04/30/2020 06:47:33.23 PM : Macro event: 42 | 1400 | 250 | 2000 | Keypress N
04/30/2020 06:47:35.31 PM : Macro event: 43 | 1400 | 250 | 1000 | Keypress ENTER
04/30/2020 06:47:36.36 PM : Macro event: 44 | 1400 | 250 | 2000 | Keypress Y
04/30/2020 06:47:38.44 PM : Macro event: 45 | 1400 | 250 | 1000 | Keypress ENTER
04/30/2020 06:47:39.48 PM : Macro event: 46 | 1400 | 250 | 2000 | Keypress E
04/30/2020 06:47:41.56 PM : Macro event: 47 | 1400 | 250 | 1000 | Keypress ENTER
04/30/2020 06:47:42.61 PM : Macro condition: 48 | IF | WINDOW TITLE | My Batch | NOT EXIST | CONTINUE
04/30/2020 06:47:42.62 PM : Macro condition - Window Title: MY BATCH NOT EXIST
04/30/2020 06:47:42.64 PM : Macro condition - Condition TRUE
04/30/2020 06:47:42.66 PM : Macro action - Running ACTION: CONTINUE
04/30/2020 06:47:42.67 PM : Macro condition: 49 | IF | WINDOW TITLE | C:\WINDOWS\system32\cmd.exe | NOT EXIST | CONTINUE
04/30/2020 06:47:42.69 PM : Macro condition - Window Title: C:\WINDOWS\SYSTEM32\CMD.EXE NOT EXIST
04/30/2020 06:47:42.70 PM : Macro condition - Condition TRUE
04/30/2020 06:47:42.72 PM : Macro action - Running ACTION: CONTINUE
04/30/2020 06:47:42.73 PM : Macro playback finished
|
|
|
Post by Steve on May 1, 2020 1:24:18 GMT
dozer2014 what version are you running? Your getting these errors in your event log: 04/30/2020 06:46:31.14 PM : Playback error: 3 | IF | STRING VARIABLE | %STRING1% | CONTAINS -C | A | GOTO MACRO LINE | 7 - Condition execution error [Unexpected Internal Error]: Object reference not set to an instance of an object. 04/30/2020 06:46:31.16 PM : Macro condition: 4 | IF | STRING VARIABLE | %STRING1% | CONTAINS -C | D | GOTO MACRO LINE | 7 04/30/2020 06:46:31.18 PM : Playback error: 4 | IF | STRING VARIABLE | %STRING1% | CONTAINS -C | D | GOTO MACRO LINE | 7 - Condition execution error [Unexpected Internal Error]: Object reference not set to an instance of an object. 04/30/2020 06:46:31.19 PM : Macro condition: 5 | IF | STRING VARIABLE | %STRING1% | CONTAINS -C | M | GOTO MACRO LINE | 7 04/30/2020 06:46:31.21 PM : Playback error: 5 | IF | STRING VARIABLE | %STRING1% | CONTAINS -C | M | GOTO MACRO LINE | 7 - Condition execution error [Unexpected Internal Error]: Object reference not set to an This should not be happening. It suggests that the syntax is not compatible which is odd because that syntax has been valid for a long time.
|
|
|
Post by dozer2014 on May 1, 2020 3:00:01 GMT
I was experimenting. Found the culprit. Under variables, clear variables on playback was checked. I misunderstood the intent. With that check cleared, it's working.
|
|
|
Post by dozer2014 on May 1, 2020 10:23:35 GMT
Currently running 7.3.0.0 That error is caused by having the % sign on the variable at the end of the input box statement.
|
|