Command failed (RunAsCurrentUser: No current user session)

Hello,
I am trying to run this script as current user but i am getting this error :“Command failed (RunAsCurrentUser: No current user session)”

override wait
RunAs=currentuser
wait “C:\Temp\Installation_Macro\InstallMacrox.cmd”

That command won’t work in the Fixlet Debugger. In a real client actionscript, it will work only when a user is logged on.

I see. But for some reason I am still getting and error through the console.

Completed prefetch f8b2b21c5b69c2a0bcd172d06d89fabffc48c1f8
sha1:f8b2b21c5b69c2a0bcd172d06d89fabffc48c1f8 size:299316
http://X.X.X.X.X/Uploads/f8b2b21c5b69c2a0bcd172d06d89fabffc48c1f8/Installation_XXXXXXXX.tmp sha256:619c183c0bdd26c1b0bb081dcdd1575afc2381d9f16e07111a8e4381cea3f53c
Completed extract f8b2b21c5b69c2a0bcd172d06d89fabffc48c1f8
Completed override wait
Completed RunAs=currentuser
Failed wait __Download\InstallMacrox.cmd

That’s a different command though. Have a look through the tips at Tip - Action Override User settings

When you’re running in the normal user context, the user doesn’t have access to the __BESData\sitename\Download folder. You’ll need to move your download out to some other directory the user can access first.

1 Like

after looking into the Tips, Here is what i am about to test tomorrow to see if it works

prefetch f8b2b21c5b69c2a0bcd172d06d89fabffc48c1f8 sha1:f8b2b21c5b69c2a0bcd172d06d89fabffc48c1f8 size:299316 http://X.X.X.X.X/Uploads/f8b2b21c5b69c2a0bcd172d06d89fabffc48c1f8/Installation_XXXXXXXX.tmp sha256:619c183c0bdd26c1b0bb081dcdd1575afc2381d9f16e07111a8e4381cea3f53c

extract f8b2b21c5b69c2a0bcd172d06d89fabffc48c1f8

waithidden cmd.exe /C mkdir “C:\temp\Macro”

copy “__Download\Installation_XXXXXXXX.tmp” “C:\temp\Macro\Installation_XXXXXXXX.tmp”

override wait
runas=currentuser
waithidden cmd.exe /c “cd C:\temp\Macro\Installation_XXXXXXXX.tmp & C:\temp\Macro\Installation_XXXXXXXX.tmp\InstallMacrox.cmd”

Please feel free to adjust if you notice an issue with the action script…

Here are suggestions:

//Download binaries
prefetch f8b2b21c5b69c2a0bcd172d06d89fabffc48c1f8 sha1:f8b2b21c5b69c2a0bcd172d06d89fabffc48c1f8 size:299316 http://X.X.X.X.X/Uploads/f8b2b21c5b69c2a0bcd172d06d89fabffc48c1f8/Installation_XXXXXXXX.tmp sha256:619c183c0bdd26c1b0bb081dcdd1575afc2381d9f16e07111a8e4381cea3f53c

//The command below will extract everything from installation_xxx.tmp to the C:\temp\Macro folder (a folder will automatically be created).
//Presuming that InstallMacrox.cmd is contained in a zipped folder called installation_xxx.tmp
extract f8b2b21c5b69c2a0bcd172d06d89fabffc48c1f8 "C:\temp\Macro"

//validate if your extracted CMD exists or not
continue if {exists folder "C:\temp\Macro" whose (exists file "InstallMacrox.cmd" of it)}

//run as current user
override wait
runas=currentuser
hidden=true
wait cmd.exe /c "C:\temp\Macro\InstallMacrox.cmd"
1 Like

Thank you everyone,

Your advice and recommendations have truly helped me customize and implement a working action script.

1 Like