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

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

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.
Answered 12/17/2004 by: jbonbright
Senior Yellow Belt

Please log in to comment
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.
Answered 12/17/2004 by: MSIMaker
Second Degree Black Belt

Please log in to comment
0
hmmm....we've been using %sys32% (%windir%\system32) for years without problems in Wise scripts on NT\2000\XP systems.
Answered 12/17/2004 by: jbonbright
Senior Yellow Belt

Please log in to comment
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.
Answered 12/17/2004 by: MSIMaker
Second Degree Black Belt

Please log in to comment
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.
Answered 12/17/2004 by: jbonbright
Senior Yellow Belt

Please log in to comment
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.
Answered 12/17/2004 by: MSIMaker
Second Degree Black Belt

Please log in to comment
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.
Answered 12/21/2004 by: BoyGenius
Orange Belt

Please log in to comment
0
If anyone cares, the answer to my question was to use %%WinDir%%
Answered 11/25/2008 by: BoyGenius
Orange Belt

Please log in to comment
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
Answered 11/26/2008 by: Jay Am
Senior Yellow Belt

Please log in to comment
0
The datatype Formatted applies to Windows Installer the OP is using WiseScript.
Answered 11/26/2008 by: Jamie B
Orange Senior Belt

Please log in to comment
Answer this question or Comment on this question for clarity