/build/static/layout/Breadcrumb_cap_w.png

How can I keep Wise from resolving %WINDIR%

I have a script that uses PSEXEC to execute a program I've copied to the System32 folder. Since I have a mixture of WINNT and WINDOWS directories, I want my command line to run %WINDIR%\SYSTEM32...

How can I do with without Wise resolving %WINDIR%? How do I keep %WINDIR% from being seen as a variable, and keep it as a string?

0 Comments   [ + ] Show comments

Answers (10)

Posted by: jbonbright 19 years ago
Senior Yellow Belt
0
It's not elegant, and you may have already thought of it, but you could create a batch file outside of Wise with the command line as you want it, then install/execute/delete the batch file in the script.

I ran into a situation where I was trying to create a temporary REG file in Wise; one of the keys had a value of "%1". Wise, of course, didn't like that at compile time, as it insisted (correctly, from its standpoint) that a "%" was missing from a variable name. I wound up creating a REG file outside of Wise and did what I described in the first paragraph above. Not pretty, but it worked fine.

And, perhaps I'm missing something, but couldn't you just use %sys32% in the command line? Forgive me if I am indeed missing something, as it's Friday and fast approaching what I affectionately call "Miller Time," so my thoughts may be partially elsewhere.
Posted by: MSIMaker 19 years ago
2nd Degree Black Belt
0
Actually the default system variable you need to use is %SystemRoot%

This is the built in variable Windows uses to find itself.

To see system variables, open a cmd prompt and type "set" for the list.
Posted by: jbonbright 19 years ago
Senior Yellow Belt
0
hmmm....we've been using %sys32% (%windir%\system32) for years without problems in Wise scripts on NT\2000\XP systems.
Posted by: MSIMaker 19 years ago
2nd Degree Black Belt
0
%sys32% IS a Wisescript system variable.....but its not a Windows System variable.

I think he is trying to use the Windows version to detect the Windows installation folder.
Posted by: jbonbright 19 years ago
Senior Yellow Belt
0
ORIGINAL: MSIMaker

%sys32% IS a Wisescript system variable.....but its not a Windows System variable.

I think he is trying to use the Windows version to detect the Windows installation folder.


I'm not exactly sure what he's trying to do, but since he said he's using Wise, %sys32% would indeed point to the directory from which he said he's attempting to execute programs. Indeed, %sys32% is not a Windows user or system environment variable, but then again I never said it was. I only mentioned it because he said he was working with a Wise script at the very beginning of this thread.
Posted by: MSIMaker 19 years ago
2nd Degree Black Belt
0
Your right....%sys32% should work for him if he is using a wisescript. He actually doesnt need the %WINDIR% part at all. I should have read it more carefully.

I only mentioned %SYSTEMROOT% so that his script....Wise or not will be able to locate the Windows folder regardless of whether its Windows or WINNT.
Posted by: BoyGenius 19 years ago
Orange Belt
0
The first reply came the closest to answering my question. The variable I use is immaterial, because I want Wise to treat is as text rather than resolving it.

If I have to use an external batch file I will, but it will be a little clunky because I'll be using the external batch file simply as a means of executing another external program.
Posted by: BoyGenius 16 years ago
Orange Belt
0
If anyone cares, the answer to my question was to use %%WinDir%%
Posted by: Jay Am 16 years ago
Senior Yellow Belt
0
On MSDN Page for the DataType FORMATTED following is written:

If a substring of the form [\x] is found, it is replaced by the character x , where x is one character, without any further processing. Only the first character after the backslash is kept; everything else is removed. For example, to include a literal left bracket ([), use [\[]. The text [\[]Bracket Text[\]] resolves to [Bracket Text].

Is this also a way to approach this goal? To use [\%]WinDir[\%] ?

URL: http://msdn.microsoft.com/en-us/library/aa368609(VS.85).aspx
Posted by: Jamie B 16 years ago
Orange Senior Belt
0
The datatype Formatted applies to Windows Installer the OP is using WiseScript.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ