Highlighted
Absent Member.
Absent Member.
4176 views

Run Script enviroment variables not working

I have had a few things not work under run scripts "Define your own script" using %comspec% when it works perfectly fine from a command prompt.

My current issue is I cannot get it to recognize enviroment variables that do show up when you run the set command from the command prompt. Here is an example of one that fails:

msiexec /i \\Server1\Source\%AnyVariable%update.msi /qn

The file name on the source would be anyvariableupdate.msi. Again when I run this from a command prompt it works with no problems. Any ideas would be appreciated this is getting to be a real problem with our migration from ZEN 7 where these scripts worked fine.
Labels (2)
0 Likes
16 Replies
Highlighted
Absent Member.
Absent Member.

Re: Run Script enviroment variables not working

Most Likely the Variable is Defined as a "User Variable" and only available
in that user's context and your script is running as System or Dyanmic
Administrator

"dausmus" <dausmus@no-mx.forums.novell.com> wrote in message
news:dausmus.3ta2yo@no-mx.forums.novell.com...
>
> I have had a few things not work under run scripts "Define your own
> script" using %comspec% when it works perfectly fine from a command
> prompt.
>
> My current issue is I cannot get it to recognize enviroment variables
> that do show up when you run the set command from the command prompt.
> Here is an example of one that fails:
>
> msiexec /i \\Server1\Source\%AnyVariable%update.msi /qn
>
> The file name on the source would be anyvariableupdate.msi. Again when
> I run this from a command prompt it works with no problems. Any ideas
> would be appreciated this is getting to be a real problem with our
> migration from ZEN 7 where these scripts worked fine.
>
>
> --
> dausmus
> ------------------------------------------------------------------------
> dausmus's Profile: http://forums.novell.com/member.php?userid=8848
> View this thread: http://forums.novell.com/showthread.php?t=375152
>



0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Run Script enviroment variables not working

It is a system variable and I have tried running it as all 3 System, User, and dynamic administrator. In ZEN 7 anything I could get to run in the command prompt was able to run in a launch script I am not having the same luck with ZCM.

Craig Wilson;1803153 wrote:
Most Likely the Variable is Defined as a "User Variable" and only available
in that user's context and your script is running as System or Dyanmic
Administrator

"dausmus" <dausmus@no-mx.forums.novell.com> wrote in message
news:dausmus.3ta2yo@no-mx.forums.novell.com...
>
> I have had a few things not work under run scripts "Define your own
> script" using %comspec% when it works perfectly fine from a command
> prompt.
>
> My current issue is I cannot get it to recognize enviroment variables
> that do show up when you run the set command from the command prompt.
> Here is an example of one that fails:
>
> msiexec /i \\Server1\Source\%AnyVariable%update.msi /qn
>
> The file name on the source would be anyvariableupdate.msi. Again when
> I run this from a command prompt it works with no problems. Any ideas
> would be appreciated this is getting to be a real problem with our
> migration from ZEN 7 where these scripts worked fine.
>
>
> --
> dausmus
> ------------------------------------------------------------------------
> dausmus's Profile: NOVELL FORUMS - View Profile: dausmus
> View this thread: Run Script enviroment variables not working - NOVELL FORUMS
>
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Run Script enviroment variables not working

I did a bit of testing today.

I manually set a SYSTEM variable on my System Via My Computer and tested to
see if it would be recognized by the Script.
It was not.
Then I restarted my system and Tested again.
It was.

Seems like the Permanent Variable is not being detected immediately until a
system resetart.
I will likely update the thread later today.
But that is my initial results.

"dausmus" <dausmus@no-mx.forums.novell.com> wrote in message
news:dausmus.3tbay3@no-mx.forums.novell.com...
>
> It is a system variable and I have tried running it as all 3 System,
> User, and dynamic administrator. In ZEN 7 anything I could get to run
> in the command prompt was able to run in a launch script I am not having
> the same luck with ZCM.
>
> Craig Wilson;1803153 Wrote:
>> Most Likely the Variable is Defined as a "User Variable" and only
>> available
>> in that user's context and your script is running as System or Dyanmic
>> Administrator
>>
>> "dausmus" <dausmus@no-mx.forums.novell.com> wrote in message
>> news:dausmus.3ta2yo@no-mx.forums.novell.com...
>> >
>> > I have had a few things not work under run scripts "Define your own
>> > script" using %comspec% when it works perfectly fine from a command
>> > prompt.
>> >
>> > My current issue is I cannot get it to recognize enviroment

>> variables
>> > that do show up when you run the set command from the command

>> prompt.
>> > Here is an example of one that fails:
>> >
>> > msiexec /i \\Server1\Source\%AnyVariable%update.msi /qn
>> >
>> > The file name on the source would be anyvariableupdate.msi. Again

>> when
>> > I run this from a command prompt it works with no problems. Any

>> ideas
>> > would be appreciated this is getting to be a real problem with our
>> > migration from ZEN 7 where these scripts worked fine.
>> >
>> >
>> > --
>> > dausmus
>> >

>> ------------------------------------------------------------------------
>> > dausmus's Profile: 'NOVELL FORUMS - View Profile: dausmus'

>> (http://forums.novell.com/member.php?userid=8848)
>> > View this thread: 'Run Script enviroment variables not working -

>> NOVELL FORUMS' (http://forums.novell.com/showthread.php?t=375152)
>> >

>
>
> --
> dausmus
> ------------------------------------------------------------------------
> dausmus's Profile: http://forums.novell.com/member.php?userid=8848
> View this thread: http://forums.novell.com/showthread.php?t=375152
>



0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Run Script enviroment variables not working

Well it is now working with system variables. Unfortunately I don't know why it wasn't working in the first place and now it is. Maybe the reboot was what I needed although I am almost positive I rebooted previous ot this. Anyway thanks for the response.
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Run Script enviroment variables not working

I am working on updating system variables with a vbscript then using those variables in a file edit action...

I have run into similar issues you have mostly regarding enviro variables and updating.

Zenworks seems to cache the system variables at start up, if you change a variable while zenworks is running it does not seem to recognize the change (or addition). If you reboot after the change then the updated variable will work.

I would prefer to use custom variables, but I may just have to use regkeys instead.

I have tried to use tools that "update or refresh" environment variables both externally and through scripts in zen, none have been successful at making Zen update its enviro variable list. Even tried various zac ref commands as well (with Zen 10.2)
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Run Script enviroment variables not working

Is anyone able to create an SR about this issue?
I could create a defect for this issue, but if it's created for a customer
with an SR it has far more weight.

If you an, simply let me know the SR# at craig_d_wilson@yahoo.com and I wil
then make the defect and ask the assigned Engineer to associate it to my bug
since I have verified this general behavior.

"dandirk" <dandirk@no-mx.forums.novell.com> wrote in message
news:dandirk.3tu03i@no-mx.forums.novell.com...
>
> I am working on updating system variables with a vbscript then using
> those variables in a file edit action...
>
> I have run into similar issues you have mostly regarding enviro
> variables and updating.
>
> Zenworks seems to cache the system variables at start up, if you change
> a variable while zenworks is running it does not seem to recognize the
> change (or addition). If you reboot after the change then the updated
> variable will work.
>
> I would prefer to use custom variables, but I may just have to use
> regkeys instead.
>
> I have tried to use tools that "update or refresh" environment
> variables both externally and through scripts in zen, none have been
> successful at making Zen update its enviro variable list. Even tried
> various zac ref commands as well (with Zen 10.2)
>
>
> --
> dandirk
> ------------------------------------------------------------------------
> dandirk's Profile: http://forums.novell.com/member.php?userid=51062
> View this thread: http://forums.novell.com/showthread.php?t=375152
>



0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Run Script enviroment variables not working

Not sure if this is a bug... I do know that I ran into a similar issue with Zen 6.5, so I kinda assumed it was working as intended.

I will speak with our head Zen Admin and have him open an SR, he deals with all the direct Novell support and support contracts.

I will probably look into seeing if maybe a dll with SendMessage HWND_BROADCAST,WM_SETTINGCHANGE, NULL,NULL command will work to update the ZCM client...
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Run Script enviroment variables not working

Well, IMHO that should not be required and the ZEN should handle this.
That does not mean that is Novell's stance, but I certainly think it should
get some strong examination.

"dandirk" <dandirk@no-mx.forums.novell.com> wrote in message
news:dandirk.3tu5ni@no-mx.forums.novell.com...
>
> Not sure if this is a bug... I do know that I ran into a similar issue
> with Zen 6.5, so I kinda assumed it was working as intended.
>
> I will speak with our head Zen Admin and have him open an SR, he deals
> with all the direct Novell support and support contracts.
>
> I will probably look into seeing if maybe a dll with SendMessage
> HWND_BROADCAST,WM_SETTINGCHANGE, NULL,NULL command will work to update
> the ZCM client...
>
>
> --
> dandirk
> ------------------------------------------------------------------------
> dandirk's Profile: http://forums.novell.com/member.php?userid=51062
> View this thread: http://forums.novell.com/showthread.php?t=375152
>



0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Run Script enviroment variables not working

We are debating on submitting a SR for this, we only have 10 a year and are currently deploying idm. If we do submit one, I will post the #.

Well I seemed to have found the process that cache's environment variables... It looks to be ZenUserDaemon.exe

If I run my script that changes variables, then kill and restart this process Zen bundles seem to recognize the updated values (but is cached again until another cycle of the process).

I wasn't able to find much information on ZenUserDaemon.exe, can anyone comment on what this does?

Ok so I seem to have a workaround. Killing the process does not SEEM to cause any issues except NALwin.exe will not function until zenuserdaemon.exe is started again. User still is logged into ZCM and the process restart seems to restore functionality to nalwin.exe without issue in my limited testing.

I tried to add the "kill process" and "launch windows executable" actions in my bundle to force zen to update its variables but obviously the bundle stalls right after the "kill process" action and fails to make it to "launch windows exe" action to restore functionality.

My next step/test will be to create a script that kills and restarts the process, hopefully this will be able to complete in time for the bundle to complete.

Any thoughts? I really don't like this type of work around but at this time I don't see any downside, anyone know of one?
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Run Script enviroment variables not working

Is there any workaround or update for this? In my situation it's very important to be able to change environment variables without requiring a reboot so this is causing a lot of problems for me at the moment.
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Run Script enviroment variables not working

Yes, There are workarounds.
Can you send an email to Craig_D_Wilson@Yahoo.Com and put "Novell Forums" in
the subject so it stands out from the 1,000s of spam I get every day 😆

--
Craig Wilson - MCNE, MCSE, CCNA
Novell Support Forums Volunteer Sysop

Novell does not officially monitor these forums.

Suggestions/Opinions/Statements made by me are solely my own.
These thoughts may not be shared by either Novell or any rational human.
"blackstep" <blackstep@no-mx.forums.novell.com> wrote in message
news:blackstep.3x703z@no-mx.forums.novell.com...
>
> Is there any workaround or update for this? In my situation it's very
> important to be able to change environment variables without requiring a
> reboot so this is causing a lot of problems for me at the moment.
>
>
> --
> blackstep
> ------------------------------------------------------------------------
> blackstep's Profile: http://forums.novell.com/member.php?userid=34467
> View this thread: http://forums.novell.com/showthread.php?t=375152
>



0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.