I need to run the cmd command as current user.
Is it possible?
Try the override actionscript command
https://developer.bigfix.com/action-script/reference/execution/override.html
RunAs
Use this keyword to specify the user and the context to use when running the command specified in the action. Default value: agent
RunAs=agent applies the same process ownership characteristics as the current wait and run commands. The user and the context are the same as those used to with the current wait and run commands
RunAs=currentuser mimics RunAsCurrentUser.exe on Windows, using the same logic to identify the current user and similar code to create the process with an environment block sourced by the userToken.
Thank you for answer.
I want to run the cmd command as a current user.
I used override but it was failed.
How do I run the command as a current user?
if {exist folder “C:\Program Files (x86)”}
dos taskkill /F /IM FdSchedule.exe
dos copy __Download\schdata.dat "C:\Program Files (x86)\FINALDATA\WPM\schdata.dat"
dos START /d “C:\Program Files (x86)\FINALDATA\WPM” /b FdSchedule.exe -startup
else
dos taskkill /F /IM FdSchedule.exe
dos copy __Download\schdata.dat "C:\Program Files\FINALDATA\WPM\schdata.dat"
dos START /d “C:\Program Files\FINALDATA\WPM” /b FdSchedule.exe -startup
endif
Something like this maybe.
parameter "MyFolder"="{(if (x64 of operating system) then (value of variable "ProgramW6432" of environment) else (value of variable "ProgramFiles" of environment)) & "\FINALDATA\WPM"}"
delete "{parameter "MyFolder"}\schdata.dat"
copy __Download\schdata.dat "{parameter "MyFolder"}\schdata.dat"
createfile until EOF
taskkill /F /IM FdSchedule.exe
start /d "{parameter "MyFolder"}" /b FdSchedule.exe -startup
EOF
delete FdSchedule.cmd
copy __createfile FdSchedule.cmd
override run
Completion=none
RunAs=currentuser
run FdSchedule.cmd
Thank you for answer!