Task Scheduler

Here you are welcome to report any Push2Run bugs you may have encountered

if you know of a workaround, it would be great if you would mention that too
pho08
Posts: 12
Joined: Sat Apr 11, 2020 5:56 am

Re: Task Scheduler

Post 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
pho08
Posts: 12
Joined: Sat Apr 11, 2020 5:56 am

Re: Task Scheduler

Post 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?
RobLatour
Site Admin
Posts: 1017
Joined: Mon Feb 19, 2018 11:43 am

Re: Task Scheduler

Post 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
pho08
Posts: 12
Joined: Sat Apr 11, 2020 5:56 am

Re: Task Scheduler

Post 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 :D 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!
RobLatour
Site Admin
Posts: 1017
Joined: Mon Feb 19, 2018 11:43 am

Re: Task Scheduler

Post 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.
pho08
Posts: 12
Joined: Sat Apr 11, 2020 5:56 am

Re: Task Scheduler

Post 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
RobLatour
Site Admin
Posts: 1017
Joined: Mon Feb 19, 2018 11:43 am

Re: Task Scheduler

Post 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.
pho08
Posts: 12
Joined: Sat Apr 11, 2020 5:56 am

Re: Task Scheduler

Post 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
Post Reply