We have a service, running as domain admin user on Win Svr 2008 std ed, that must execute vb scripts. The scripts execute, but calls to SETX.exe using Shell.Run fail to set environment variables. However, SETX returns no errror msg.
If I run the same script within a CMD window with elevated privilege (e.g. Administrator), the script works as expected and environment variables are set.
What is going on? File creation fails as well.
The call looks like this:
gnReturnCode= RunCmd("setx.exe UD_UPGRADING_RELEASE "True" /m",True)
Where RunCmd is as follows:
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Function: RunCmd( ByVal strCmd, ByVal bWait)
' desc: Execute a command string and wait for result if indicated
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Function RunCmd( ByVal strCmd, ByVal bWait)
Dim nReturnCode, strWholeCmd
nReturnCode= 0
strWholeCmd= "%comspec% /c "&strCmd&" >"&gcsLogFile2
nReturnCode= goShell.Run(strWholeCmd,0,bWait)
WriteLog( "RunCmd("&strCmd&","&bWait&") returned "&nReturnCode)
RunCmd= nReturnCode
End Function
Mark Maddox Sr. Tech Specialist