Hi,
I use "Run program in guest" workflow in order to run the flowing reg add command:
reg add HKEY_LOCAL_MACHINE\SOFTWARE\Company /t REG_SZ /v team /f /d "operation"
The arguments variable which pass to "Run program in guest" workflow:
arguments = "-command \"& {reg add HKEY_LOCAL_MACHINE\\SOFTWARE\\Company /t REG_SZ /v team /f /d \"operation\"}"
In this case it works!
However if I pass a value with space it does not create the registry.
for example:
arguments = "-command \"& {reg add HKEY_LOCAL_MACHINE\\SOFTWARE\\Company /t REG_SZ /v team /f /d \"operation department\"}"
if I run same command from the virtual machine it works:
reg add HKEY_LOCAL_MACHINE\SOFTWARE\Company /t REG_SZ /v team /f /d "operation department"
What can be the solution for this space issue?
Thanks!
Hmmmm... I'm guessing your actual command to the "Run program in guest" is powershell.exe
and you want to pass the "reg add" as the "command" argument there.
This might mean it's a powershell problem & not JS
try this perhaps?
arguments = "-command \"& {reg add HKEY_LOCAL_MACHINE\\SOFTWARE\\Company \/t REG_SZ \/v team \/f \/d 'operation department'}\""
i.e., specify the value in single quoutes - 'operation department'
I think you might have unbalanced quotes in this line?
hi,
I added your suggestion in the end of the line, but the problem still occurs.
Only if I have space in value, the registry is not created.
Any other ideas?
Thanks!
Try this? (escape the forward slashes too)
arguments = "-command \"& {reg add HKEY_LOCAL_MACHINE\\SOFTWARE\\Company \/t REG_SZ \/v team \/f \/d \"operation department\"}\""
same problem...
Hmmmm... I'm guessing your actual command to the "Run program in guest" is powershell.exe
and you want to pass the "reg add" as the "command" argument there.
This might mean it's a powershell problem & not JS
try this perhaps?
arguments = "-command \"& {reg add HKEY_LOCAL_MACHINE\\SOFTWARE\\Company \/t REG_SZ \/v team \/f \/d 'operation department'}\""
i.e., specify the value in single quoutes - 'operation department'
it works!
Thanks a lot!