Runas current user failed

I am trying to run below task but when I am executing it, it getting failed on runas=currentuser.

RunAs=currentuser

if {exists current user and exists key “Software\Classes\Local Settings\Software\Microsoft\MSIPC\dev1” of current user keys (logged on users) of native registry}
if {x64 of operating system}
wait reg Delete “HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\MSIPC\dev1” /f /reg:64
else
wait reg Delete “HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\MSIPC\dev1” /f
endif
endif

if {exists current user and exists key “Software\Microsoft\Office\16.0\Common\DRM” whose (exists value “DefaultServer” whose (it as string = “fdev”) of it) of current user keys (logged on users) of native registry}
if {x64 of operating system}
wait reg Delete “HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Common\DRM” /v DefaultServer /f /reg:64
wait reg Delete “HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Common\DRM” /v DefaultServerUrl /f /reg:64
else
wait reg Delete “HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Common\DRM” /v DefaultServer /f
wait reg Delete “HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Common\DRM” /v DefaultServerUrl /f
endif
endif

I believe RunAs=currentuser is a parameter that must be on a line following override wait. The two lines may need to be repeated before each wait statement as well.

2 Likes

many thanks Great help ! worked in single hit :smiley::smiley::smiley: