jsams Posted February 2, 2011 Report Share Posted February 2, 2011 Can someone either give me insight or verify this issue on their machine? I use virtualization almost exclusively in my work. At any one time, I'm typically administering two dozen different virtual machines. Now if I name a VM "VM-Foxtrot", there is no way for that VM to self-reference its name [a configuration report, for example]--until I create a registry value within each VM. Okay, done. The macro only runs at startup of the VM [after MEP loads], and should display the prompt only one time: <IF REGISTRY Key="TRUE" Exists="FALSE" Path="HKEY_LOCAL_MACHINE\\SOFTWARE\\Macros\\VM"/> <VARIABLE SET STRING Option="\x01" Destination="VM" Prompt="Name this VM:" Mask="FALSE" OnTop="FALSE" Left="Center" Top="Center" Monitor="0"/> <WRITE REGISTRY VALUE Key="HKEY_LOCAL_MACHINE\\SOFTWARE\\Macros\\VM" Destination="%VM%"/> <ELSE/> <MACRO STOP/> <END IF/> Except this macro still prompts at every startup of every VM, asking for a VM name when the registry key and string value already exists. I put a delay on MEP starting, it still prompts every time. I flopped the logic; still prompts. Sure, all I have to do is cancel the prompt forevermore after the initial run, but it still annoys me to no end why this simple macro doesn't work as expected. So, either I'm missing something fundamental [i don't know what I don't know], or it's a virtualization issue, or possibly a defect in MEP 4.2.2.1. Thoughts? Quote Link to comment Share on other sites More sharing options...
paul Posted February 3, 2011 Report Share Posted February 3, 2011 This issue has nothing to do with virtualization. How do I know that? I ran your macro in my normal Windows 7 environment, and was prompted for the value each time. At first I thought the problem must lie with Permissions, but soon discovered this was not the case. Curiously, your own code contains the answer! Line 1 checks for the existence of a registry key, while line 3 writes a registry value! Simply change line 1 to check for the existence of the registry value VM. Quote Link to comment Share on other sites More sharing options...
jsams Posted February 3, 2011 Author Report Share Posted February 3, 2011 Well, stupid is as stupid does. Once I'd decided it was a bug in ME, I was blind to the bug in my code. Thanks, paul. My face will eventually quit being this color... Quote Link to comment Share on other sites More sharing options...
paul Posted February 4, 2011 Report Share Posted February 4, 2011 Well, stupid is as stupid does. Once I'd decided it was a bug in ME, I was blind to the bug in my code. Thanks, paul. My face will eventually quit being this color... Nothing to do with stupidity. I can stare at a few lines of code for hours and fail to see the obvious problem. If I walk away for a while, then come back to the problem, I can often see immediately what it previously took me hours to miss! Another technique is to explain, in excruciating detail, to another person (real or imaginary) exactly what the code does. It's amazing how often that does the job! Quote Link to comment Share on other sites More sharing options...
Cory Posted February 8, 2011 Report Share Posted February 8, 2011 Another technique is to explain, in excruciating detail, to another person (real or imaginary) exactly what the code does. It's amazing how often that does the job! I do this frequently as well! Too funny. Pity the fool who has to listen to me only to have me mercifully trail off mid sentence as I realize my mistake and go flying back to the computer. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.