07y05m29d Posted May 30, 2007 Report Share Posted May 30, 2007 Created a script that intends to for example, replace instances of "D:\Win510 Users.A" with "%UserProfile%" under the TypedURLs registry key. The problem is that "%UserProfile%" keeps being substituted. Is there a way to prevent Macro Express from substituting a variable in a command ? . . . If not, perhaps an checkbox labeled, "Prevent Variable Substitution" could be added to the appropriate commands in the next release. Regardless of whether or not it is currently possible, an answer would be appreciated. (so that I may move on) Thanks. Quote Link to comment Share on other sites More sharing options...
kevin Posted May 30, 2007 Report Share Posted May 30, 2007 There is not a way to prevent variable substitution. You may be able to use two separate macro commands to accomplish what you need. Try doing this Replace Substring: "D:\Win510 Users.A" with "%UserProfil###" and then do this Replace Substring: "###" with "e%" Quote Link to comment Share on other sites More sharing options...
07y05m29d Posted May 30, 2007 Author Report Share Posted May 30, 2007 The consideration and reply is much appreciated Kevin. This is another issue had been racking my brain over and had already attempted a similar work-around using "Variable Set to ASCII Char" to no avail. I also attempted your suggested variation on a work-around as well and unfortunately no dice. (v3.5e) The substitutions are probably performed in a latently executed common routine called with every command. Quote Link to comment Share on other sites More sharing options...
07y05m29d Posted May 30, 2007 Author Report Share Posted May 30, 2007 On a side note, it doesn't appear to work with variables but in DOS/Console, the character "^" can be placed before executable characters such as ampersand "&" and pipe "|" to prevent execution. In the process, the "^" character is automatically stripped, just leaving the executable character. (if this string is then parsed again, that character will then be executed) Example: ECHO Repeat this sentence ^& do not give an error. ECHO Repeat this sentence & give an error. Quote Link to comment Share on other sites More sharing options...
07y05m29d Posted May 30, 2007 Author Report Share Posted May 30, 2007 My error... in a console window it actually does work with variables. Maybe it didn't work before because it may be necessary to double-up (or triple?) on the "^" when executed from within a script file. 8:56:40.24 Wed 05/30/2007 Windows Environment E:\Temp>echo %^userprofile% %userprofile% 9:00:27.15 Wed 05/30/2007 Windows Environment E:\Temp> Unfortunately what works for the WinNT/XP Console, does not work for MacEx. (at least not yet ) 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.