VMware Cloud Community
GarTomlon
Enthusiast
Enthusiast
Jump to solution

Update Registry settings in Windows

I know that I can accomplish this via a batch file, but I would like to be able to accomplish this by way of direct command via Run Program on Guest work flow if possible.  For instance, I would like to disable LUA / UAC.  Simply setting HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA" to 0.  I have created the BAT file and run it thru, vRO, but I would like to try and get it to work by having the Run Program on Guest call Reg.exe directly. 

Along with the vm, vmUsername, vmPassword, I have set the following:

workingDirectory - c:\windows\system32\

programPath - c:\windows\system32\reg.exe

arguments - add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v EnableLUA /t REG_DWORD /d 0 /f

I know that it is finding the filename, as I had typos in the attribute values and it returned file not found.  I corrected those, at it bypassed that error and received another general error below.

+++++++++++++++++++++++++++++++++

2018-01-05 12:09:17.642] [E] Error in (Workflow:Run program in guest / Scriptable task (item1)#15) A general system error occurred: vix error codes = (3004, 0).

[2018-01-05 12:09:17.656] [E] Workflow execution stack:

***

item: 'Run program in guest/item1', state: 'failed', business state: 'null', exception: 'A general system error occurred: vix error codes = (3004, 0).

(Workflow:Run program in guest / Scriptable task (item1)#15)'

workflow: 'Registry Settings' (5318d794-365d-4ced-a2d6-2140bba3e75c)

|  'attribute': name=vm type=VC:VirtualMachine value=dunes://service.dunes.ch/CustomSDKObject?id='vdiavc.genpt.net%2Cid:vm-2087'&dunesName='VC:VirtualMachine'

|  'attribute': name=workingDirectory type=string value=c:\windows\system32\

|  'attribute': name=programPath type=string value="c:\windows\system32\reg.exe"

|  'attribute': name=arguments type=string value=add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v EnableLUA /t REG_DWORD /d 0 /f

|  'attribute': name=InteractiveSession type=boolean value=__NULL__

|  'attribute': name=environment type=Array/string value=__NULL__

|  'input': name=vmUsername type=string value=vdiadmin

|  'input': name=vmPAssword type=SecureString value=__NULL__

|  'no outputs'

--workflow: 'Run program in guest' (C98080808080808080808080808080805E80808001322751030482b80adf61e7c)

  |  'input': name=vmUsername type=string value=vdiadmin

  |  'input': name=vmPassword type=SecureString value=8BW76X64N69G40W64K6DS31N6EQ3E40D04TC5F3EC8X4858A6BM9E04D36SEEE4CD4TBDD37E0LDF0AC85K7982FABRA60B99EH273F297P28FA4BSD3B9B38V6F13595Y8500773H258F11CSDE686BBND936BEAQ3A7441BO41D44B8G204E43AUF09DCDR3DE13A6MEF74C4RAE145ABQ

  |  'input': name=vm type=VC:VirtualMachine value=dunes://service.dunes.ch/CustomSDKObject?id='vdiavc.genpt.net%2Cid:vm-2087'&dunesName='VC:VirtualMachine'

  |  'input': name=interactiveSession type=boolean value=__NULL__

  |  'input': name=programPath type=string value="c:\windows\system32\reg.exe"

  |  'input': name=arguments type=string value=add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v EnableLUA /t REG_DWORD /d 0 /f

  |  'input': name=workingDirectory type=string value=c:\windows\system32\

  |  'input': name=environment type=Array/string value=__NULL__

  |  'output': name=result type=number value=null

  |  'no attributes'

*** End of execution stack.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Any help will be appreciated.

0 Kudos
1 Solution

Accepted Solutions
iiliev
VMware Employee
VMware Employee
Jump to solution

Error 3004 is VIX_E_PROGRAM_NOT_STARTED - A program could not run on the guest operating system.

Could you try to run the workflow with a slightly different parameters:

- programPath:    c:\windows\system32\cmd.exe

- arguments:    /c reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v EnableLUA /t REG_DWORD /d 0 /f

View solution in original post

0 Kudos
4 Replies
qc4vmware
Virtuoso
Virtuoso
Jump to solution

I've got a few suggestions to try:

1.  Have you already confirmed you can successfully run a simple command with no errors?  Directory listing or whoami for example?

2. Try removing the quotes around the registry path in the arguments line or escaping them

3. Try creating a batch file and uploading the resource instead of running the command + arguments.  I've defaulted to this method for a lot of what we are doing as I have run into some issues with the way the scripts are wrapped, unwrapped, and executed in the guest.  I'm wondering if those quotes or slashes in the command are causing the command to get mangled.

0 Kudos
GarTomlon
Enthusiast
Enthusiast
Jump to solution

Well, the batch file works.  I can create the batch file nad place them on VCO.  I have a workflow to copy the file and then call the batch file.  That works great, just a little additional overhead in managing the bat files.  But simply looking at the more direct way.  Thanks.

0 Kudos
iiliev
VMware Employee
VMware Employee
Jump to solution

Error 3004 is VIX_E_PROGRAM_NOT_STARTED - A program could not run on the guest operating system.

Could you try to run the workflow with a slightly different parameters:

- programPath:    c:\windows\system32\cmd.exe

- arguments:    /c reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v EnableLUA /t REG_DWORD /d 0 /f

0 Kudos
qc4vmware
Virtuoso
Virtuoso
Jump to solution

Ah... my bad I thought this was a question about using the guest script manager.  Not enough coffee.  You might take a look at that utility.  Its great for taking the overhead out of managing these tasks. I've used it for years and love it.  You can grab it from here Guest script manager package - Samples - VMware {code} .

Did you verify running a simple command works?  I'm wondering if you are hitting a chicken/egg thing with UAC.  If when the guest tools kicks up the command and its not already in an administrative context that might cause some issues with various commands.