Page 2 of 2
Re: Task Scheduler
Posted: Fri Apr 17, 2020 10:23 am
by pho08
thanks for the reply.
i tried it and it does not seem to make a difference whether the admin flag in the card is checked or not. push2run returns the same error.
However, i found out that this only happens when trying to run external applications from push2run (e.g. mainly batch files pointing at the .exe files of volume control / resolution changer. but also any other executable).
at the moment it is kind of hard to test though because there seems to be a severe connection problem with pushover (as detailed in the other thread).
regards
Re: Task Scheduler
Posted: Sun Apr 19, 2020 6:26 am
by pho08
update:
so i was wrong and you were right after all Rob: enabling admin priv on the p2r cards did the trick. executables now launch just fine. sorry for the confusion.
However, ever since a couple of days ago Push2Run will not run any VBScript (.vbs) files anymore.
Code: Select all
"the action was run but appears to have failed"
but it is really only vbscript files that do not work anymore.
is this a general problem or is this just me? it used to work just fine.
:edit
i think i can pinpoint the source of this problem:
- VBcripts will not work if in Pus2run the admin card is checked for the specific task pointing at a .vbs; it has to be unchecked
- VBcripts will not work if Pus2run is run via the task scheduler workaround you proposed Rob as soon as i quit p2r and reopen it the VBscripts will work.
do you have any idea to fix this?
Re: Task Scheduler
Posted: Sun Apr 19, 2020 10:08 am
by RobLatour
Glad you're making progress.
What you're now dealing with seems to be a normal thing for Windows, here is a post that explains how to deal with it:
https://stackoverflow.com/questions/174 ... r-from-vbs
Re: Task Scheduler
Posted: Sun Apr 19, 2020 11:08 am
by pho08
thanks rob for pointing me to that helpful resource!
so i added
Code: Select all
Set WshShell = WScript.CreateObject("WScript.Shell")
If WScript.Arguments.Length = 0 Then
Set ObjShell = CreateObject("Shell.Application")
ObjShell.ShellExecute "wscript.exe" _
, """" & WScript.ScriptFullName & """ RunAsAdministrator", , "runas", 1
WScript.Quit
End if
to the beginning of my .VBS, now this happens:
- when executed with "admin" flag enabled in the p2r card --> "the action was run but appears to have failed"
- when executed without admin flag enabled in the p2r card --> UAC prompt asking for admin permissions for "MS windows based script host" but after confirming the prompt the script runs.
i have a feeling we're close
now if i could just get rid of that last UAC prompt or enable p2r to execute it with admin flag enabled in the respective p2r card
as always, any thoughts highly appreciated!
Re: Task Scheduler
Posted: Sun Apr 19, 2020 4:27 pm
by RobLatour
Ok - well I didn't know this existed, but it looks like it may be the final piece:
https://tweaks.com/windows/39115/disabl ... istrators/
of course, that would cover things not driven by Push2Run as well.
Re: Task Scheduler
Posted: Mon Apr 20, 2020 6:12 am
by pho08
thanks again for your reply.
while this does indeed resolve the situation, i am afraid it is far from optimal either:
what it does is disable the UAC for elevated status in general system-wide.
- Not only does this render your original task-scheduler fix obsolete (since there is no more UAC to boot)
- what's more worrisome to me is the security aspect of just allowing any app to trigger elevated status on its own (i.e. w/o notifying me first)
hence i am still looking for a fix to:
- either enable P2Run in administrator mode to execute vbscripts w/o admin card enabled
- or make P2Run in admin mode execute vbscripts with admin card enabled but without triggering the UAC prompt.
couldn't find anything yet, so if you have another idea it would be mighty appreciated
cheers
Re: Task Scheduler
Posted: Mon Apr 20, 2020 8:02 am
by RobLatour
agreed, it is not ideal.
However, ultimately I think what you are trying to do is something the MS is trying to ensure you are not able to do - i.e. the workarounds etc. are really that.
The last rabbit I could think to pull out of the hat is to see if with the setup above which you had working and were comfortable with (without the change to the policies), will allow you to run an .exe file without the prompt.
If you can, then this program (
https://www.vbsedit.com/ ) which I have never used and can't vouch for, claims to be able to convert a .vbs file to an .exe file.
Re: Task Scheduler
Posted: Mon Apr 20, 2020 9:03 am
by pho08
that's an awesome idea, thank you.
another workaround that i came up with was working with AutoHotKey, i.e. passing on a certain keystroke/key combination from p2run to autohotkey which then uses this virtual keystroke signal to execute the .vbs
albeit not ideal either