In NAV 2009 you had the option of creating automations on either the server side or the client side.
Thus,
CREATE(WSHShell,FALSE,TRUE);
MESSAGE('%1',WSHShell.ExpandEnvironmentStrings('%temp%'));
would give me the temp variable for the client, while
CREATE(WSHShell,FALSE,FALSE);
MESSAGE('%1',WSHShell.ExpandEnvironmentStrings('%temp%'));
would give me the temp variable for the server.
(WSHShell points to the automation 'Windows Script Host Object Model'.WshShell).
In NAV 2013 the last CREATE parameter must be TRUE which leads me to the question:
How do I reestablish the functionality I had before? How do I get the environment variable as seen from the server side?
Brian Rocatis
Senior NAV Developer
Elbek & Vejrup
0
Comments
Name DataType Subtype
environment DotNet System.Environment.'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
MESSAGE('%1',environment.GetEnvironmentVariable('temp'));
environment.InsertEnvironmentVariables('%temp%\User\file%username%') returning 'C:\Users\BROCAT~1\AppData\Local\Temp\User\fileBRocatis3101'. I can't seem to find anything like that in DotNet (which doesn't exactly lack options).
Guess I'll have to write a parser myself. Thanks for putting me on the right path.
Senior NAV Developer
Elbek & Vejrup
See under: ExpandEnvironmentVariables
It does exactly what you want.