What does the final establishment of a registry value? [reg files] [environment variables]

Q: I have used many times regedit, I know how to write. and they run. If I run, and look in Regedit with the tool, I see it shows that I immediately.

For 3 for a small handful of button, I have three versions of our application that I need to test and Im tired of going into the System Properties there was. Depending on what I want to open, the clerk tells the app what version do.

Hey! They are in the registry and I know how to do it! So with the 3 files and 3 push buttons on the taskbar, much faster. And yes, I got it all back up first.

But the application does not seem to pick up the change immediately. Even opening a command prompt (this is Windows XP) and call “set” the value is not “adapted” to the new one I just set. This really scared me. Playing around with things, I tried to open the System Properties / window and just click OK without any changes. That does it. So there is something that makes the change processes are available to new opening, that just running the reg file not.

What do I add a script or reg file to make the kick?


Data Recovery Software – Deleted File Recovery – 75% Commissions
Re:Do you mean to launch the test process itself from the script? Yes, I see that would work. But the app getting tested gets called from inside the testcase scripts in the SilkTest testplan file, and the SilkTest scripts call for actions from other executables.

What I'm looking for is setting the environment, then working for an hour or so using the SilkTest IDE to run the SilkTest scripts, which it does by calling to its SilkTest Agent and passing it the script, then the Agent calls the application, which opens its window, and the Agent drives it through the testcase, and the app itself calls a number of underlying separate standalone exe's, some windowed, some not. The environment for all the related pieces of our product will expect to find the same values set in my kickoff "set" script and run on them.

Then I would close SilkTest, reset the environment, and go back to running SilkTest scripts from the IDE.

I will try that on Tuesday and see if the inheritance of the environment cascades all the way out to all involved executables.


File Crumble-Powerful File Shredding No File Recovery!
Re:Originally posted by: guy
because that will set for the process running the script. My test process and the app process would not know about it

:roll: You call set in your script and then launch your test process. That process will inherit the environment that you setup. Your jumping thru hoops to do something that is already completely supported and has worked since basically DOS 1.0.


Duplicate File Cleaner
Re:Well, nothinman was on the track. I did a little more detailed searching for "set" and found that the XP Resource Kit has setx.exe, that does what I want!

File R/d | Recover Deleted Files Or Permanently Delete Them
Re:because that will set for the process running the script. My test process and the app process would not know about it

Home Office Electronic Filing System – No more messy files!
Re:so why not write a script that uses set?

FileLock #1 Security Software**Up to $70/Sale**Crazy Conversion Hook!
Re:My fault, not enough detail from this end.

I think I'm following you OK. My actual use of it is the pertinent thing.

I do automated testing of a big GUI application. I write test scripts in SilkTest that run the application, it's fun – you tell the script what you want it to do, and it opens the application and moves the mouse and enters stuff in the text fields and clicks the buttons and all that – no one but SilkTest is making it happen. The tests include verifications of what happens.

One of the things we have to deal with is whenever we make changes in a script, we have to make sure that it also runs correctly on any earlier versions, and that's always an adventure. The thing is that there are certain things inside the application that are controlled by – Windows taht are created by the installer, and it's the responsibility of the user to know that if he needs to, and if he makes certain changes he has to edit them. Using the System Properties tool, that works of course. Different versions do not run correctly on other versions' , which are mostly paths to where the app expects to find certain files.

So as a tester, I sometimes end up with having to run my tests against each of 4 different versions, each of which has several variables to change. After a long time of saying "OK, finished running that test against version 12.5, let's switch to version 15.0 and run it." Then 15.0.1 and then 15.0.2. Not a killer, but I always like to find little convenience tricks, and I'm a software engineer and I'm supposed to be smart enough to do things like that.

So in this case a reg file seemed to be the thing to do. At my last job the app we built used the Registry to store things, but they werent . Back then I did the trick and it worked fine. I forgot about it till now and when I said "Hey, let's do it here!" I was surprised that simply running the I wrote (they were correct) did not make the immediately "available".

I understand the set command, and at time use it here to set the environment in a DOS window, but in this case I am not working in a DOS window, I want to set the variables and then have them available to the processes that run my app and SilkTest. That is where I am finding the stone wall.

So what was said above, about being able to do it if I knew how to get at the underlying session manager thingie, is probably the only hope, and like I said it's not crucial, just very very interesting.

Did that clarify?

Thanks again

F


Ultimate Magazine Headline Swipe File
Re:I'm not sure if we're connecting on this idea or not…answer a quick question and i"ll know: You know that the Set command is used to set and not just to view them right?

reside in memory, unrelated at all to the registry. have existed since DOS. Back in the DOS days they got placed in memory during boot by autexec.bat. Now they are getting set by session manager (who just happens to save them on disk in the registry hive files).

You could update it into the live session merely by updating it in the registry AND the at the same time. It could then "refresh" from the registry at it's leisure but won't really be changing anything because you've already done it.


The Peoples Chemist Secret Health Files
Re:Both of you, that's what I have been told by others here at work, who have many more years than I have.

My previous experience with writing to the Registry, including doing it in code, never ran into this. Evidently, as you are saying, the are stored in the Registry, yes, but they are actually used and referenced from whatever you are calling it, the Session Manager. I can wrap around that. Still wish I could trigger the "refresh" or update, or whatever, into the "live" OS session, from code. I've looked around some, but havent found anything much about it.

This is the kind of thing I can spend many happy hours chasing after, probably way more than I would ever save by not having to use the System Properties to do it.

:-)


Final Sync – Automatically Synchronize Your Files!
Re:ok so what you are after is a changing set of right?
You are leveraging the registry to accomplish this but not so much interested in what's actually in the registry so long as the are properly set?

could be wrong here but..

The that you see in the registry are just there as a place to permanently store the variables between reboots. The session manager sets up those variables in memory each boot and they are referenced from memory, not the registry.

To get them "refreshed" from the registry you need to either restart the session manager (not really possible without a reboot) or trigger some code in the OS that causes the session manager to rebuild the from the registry. Hitting the 'OK' in system properties after adjusting the variables there probably does this.

If what you are after is just changing the , use the "Set" command via the command line. It just immediately changes the in memory and you're good to go.

edit: and when I say use "set" here I mean using the command to literally set the variables, not just view them (aka run "set" without any parameters). See "set /?" for info.


eFileKeeper eBook – Organize, Backup and Manage Files and Folders!
Re: are special, when you set them via the System Properties it does some extra magic to make them take affect. You would need to find out what function that is and call it via VBS or a custom program after changing your variables.

Related posts

Leave a comment

0 Comments.

Leave a Reply


click to changeSecurity Code

[ Ctrl + Enter ]