sunny Posted April 28, 2009 Share Posted April 28, 2009 Hi I want to replace the hard code values in my script with some variables. Can I use the environment variable concept here as we use in QTP? If yes they i request to let me know the way i can use it do i have to create a xml file with variable and value combination? thanks in advance Link to comment Share on other sites More sharing options...
Richard Robertson Posted April 28, 2009 Share Posted April 28, 2009 Environment variables are meant more for sharing information between child processes. If you are asking how you can import some "set up" list of variables, there are plenty of ways. INI files are one of the most common. AutoIt has built in INI support. Link to comment Share on other sites More sharing options...
Danny35d Posted April 28, 2009 Share Posted April 28, 2009 EnvGet ( "envvariable" )Example:$var = EnvGet("PATH") MsgBox(4096, "Path variable is:", $var) AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line Link to comment Share on other sites More sharing options...
LurchMan Posted April 28, 2009 Share Posted April 28, 2009 (edited) RegWrite(HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" , $var , "REG_SZ" , $val) this will set env variables to the machine. Edit: Envset works for child process also as stated above, this will work for anything program that you run on the machine Edited April 28, 2009 by LurchMan Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now