The following script causes a modal dialog box, with the title Macro..., to pop up when the script executes the setenvvar command. The user must click the OK button in the dialog box before processing continues. How do I keep the dialog box from appearing each time setenvvar is executed? I've included an example of the scripts causing the problem.
//testenvvar.exe
let>test1=Yo! Yo! Yo!
setenvvar>test,%test1%
wait>.3
run program>C:\Program Files\MJT Net Ltd\Macro Scheduler\testenvvar2.exe
//testenvvar2.exe
getenvvar>test,test
messagemodal>%test%
Thanks,
JWM
SetEnvVar causes an modal Dialog box to popup
Moderators: JRL, Dorian (MJT support)
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
SetEnvVar Popup
Bob,Bob Hansen wrote:I get the same result. The window that comes up shows the message "true".
I tried adding CloseWindow>Macro* as next command, but the "true" message comes up before that line of script is executed.
That cleared up the problem for me in both the test script I posted and the application script.
Thanks,
JM
The SetEnvVar function sets the value of an environment variable for the current process. The environment variable will therefore only be available to the same process or it's child processes. You won't therefore see it in Windows. Only the same script or a script, process or other application spawned by that script will be able to see that environment variable using GetEnvVar.armsys wrote:Neither can I find any environment variable set by the SetEnvVar. Instead of creating an environmnet variable, it always pops up a "true" message box.
You would have the same result if you created an environment variable using the Set command in a CMD.EXE session. Those variables will only exist in that session. Close the session and those environment variables will no longer exist. Any process started by that CMD.EXE session will have access to them.
For more info see:
http://msdn.microsoft.com/library/en-us ... iables.asp
The bug where the "true" message box pops up has been removed in 7.3.07.
MJT Net Support
[email protected]
[email protected]
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Maybe in the future a switch can be added to make the SetEnvVar variable persistent?
In the meantime, using XSET is a useful utility to do many things with environment variables. An excerpt from the literature:
In the meantime, using XSET is a useful utility to do many things with environment variables. An excerpt from the literature:
You can use XSET now in Macro Scheduler with Run Program>XSET main goal is productivity. It lets you write full-featured batch files in just a few minutes. You do not have to learn a new language or environment, you just call XSET when you need it in your usual batch files.
XSET is the most powerful environment variable manipulation program you have ever seen. It also has a very easy and intuitive user interface (very close to the SET command) you only need to use the functionality you need, you do not have to worry about the functionality you do not use. It is not a resident program; so it will not interfere with any of your other applications.
-----------------------------------
XSET major features
Catch the output of any command (internal or external) or program and put it into an environment variable
Manages variable contents of more than 128 characters (your path can now be as long as you want)
Built-in commands to modify the output of a program or a string given on the command-line (extract a part of a string, ...)
Built-in full floating-point calculation functionality: You can program incremental loops, input a calculation string and output the resulting number, ...
Built-in commands to give you access to a lot of system data (date, time, file attributes, CPU type,...)
Built-in commands to clear the whole environment or restore a previously saved one
High-level input/output user interface (line-editing, colors, windows, boxes, ...)
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!