Task Scheduling not executing a Powershell script that can be manually run through Task Scheduler (Windows10) - powershell

Trying to follow this guidelines https://github.com/vstarostenko/dv8p_wifi_issue_fix/blob/master/README.md I have now a Powershell script that works, but that is not triggered with event 507.
The script works if manually run through Task Scheduler (in windows 10) (shown by history record and because I have an alert in the script that displays a message)
The 507 event is shown in the event-viewer when it moves back from standby
And the marked options in the Task appear to be correct (see below)
*But the script doesn't run in response to the event
Any idea?

I tried running the task not based on the event but on a particular minute, and it worked.
Then I tried to do the same event trigger, but then something changed. I did exactly the same but in the "Source" input, except saying Kernel-power, it now says Microsoft-Windows-Kernel-Power, having selected the same.
And now it works.
My assumption, I updated 2 days ago the system and it downloaded several critical files (I didn't pay attention, but it sounded to me to the first windows10 pseudo-service-package that I read few days ago). I guess that they corrected the bug(?), but that it still persisted until I have re-done the Trigger again.
Anyway, now it works :)

Related

Task Scheduler doesn't send email in the night

I have a batch file that runs a piece of R script, which scrapes some websites and results in two actions: (1) save the data and (2) send it to me through email.
I want this to be done on a daily basis during the night so that each day in the morning I will have some updates. So I set a task in Task Scheduler that runs at 2am each day. However, it didn't work as intended. I could see the website were scraped and the data were saved (by checking modified time), but never got the email.
Pretty sure both the R script and the batch file works perfectly if I run them in the normal way. More strangely, if I set the task to be triggered at, say, 10am when I am normally logged in and using the PC, everything works just fine and I can get the email.
So the only difference is that at 2am my PC is locked (not logged out) whereas at 10am I am using the PC. However, I have ticked the options 'run whether user is logged on or not' and 'run with highest privileges' in Task Scheduler anyways, so I cannot see where the problem is. Any help? Thanks!
Tried various setting options in Task Scheduler but didn't work.

Is there a way to run an action immediately upon executing the installer?

I have an application whose installer is built with Install4J and when I run the Windows installer exe file the GUI doesn't appear until after about 15 seconds. During this time, there's an empty console visible to the user, and they may get the impression that nothing is happening.
What I'd like to do is simply print a message to the user, so they know the installer is running prior to the GUI appearing (or some other solution with a similar effect).
I added an action to the "Startup" section of the Install4j config that prints a message to the console. As far as I can tell, this is the earliest I can configure Install4J to do an action. It works great except that it doesn't print until after the GUI has already loaded, which defeats the purpose. It's currently the only action in the "Startup" section - moving our other startup actions to happen later didn't have any effect on how soon the message is displayed.
In the i4j_nlog_1 log file, it says what was happening during those 15 seconds before the GUI appears. ~5.5 seconds are verifying integrity, and ~7.2 seconds are extracting/creating. Ideally, I'd be able to print a hello message prior to any of that.
By default, installj4 immediately shows a native progress dialog when the installer is executed.
It is possible to deactivate that progress dialog by deselecting the "Suppress initial progress dialog" property on the "Installer" node in the "Installer->Screens & Actions" step.

Script runs fine in ISE, but not in Powershell Console

I wrote an extremely lengthy script that creates a form. The main purpose of it it to connect to vCenter servers, total up hosts/vms within different datacenters and also identify ESXi host versions. Running the script in ISE the form loads fine and when I click the Button to start the many various functions to update the fields, it runs. I have Foreach() fields throughout and added in a little StatusLabel to the bottom of the form to show me where in the script it is currently scanning.
Once all was done and working, I saved the PS1 file and moved it to a shared server to be run. When I run the Powershell console (as Admin) and point to the file, the Form loads ok. Once I click the button to begin generating the info, It just changes to (Not Responding) and grays out. I know it's working and if left there long enough it will return the info.
Why does the console window not function like the ISE? I want to be able to see the information and Status Label update/change as it goes through the script (just like I do in the ISE).
Appreciate the feedback. The script is several thousand lines long and would need to be scrubbed before I upload. Was hoping to just get some general info before doing that.
I updated to v4 and verified that my command window was running as STA using the command from Jan Chrbolka. Script runs properly now.
I was also facing the same issue.(Btw, I cannot upgrade Powershell to V4 right now since it is my company owned one.)
The Browse button that I incorporated in my form was not working when I am lauching it from Powershell command line. It went to Not Responding state when I click the browse button.
I took the advise from Jan ChrbolkaMay about the STA and MTA.
I checked for the threads related to that and changed the script execution format to the below one which fixed my issue.(adding the word -STA)
powershell -STA -File D:\PS\GUI.ps1
For checking the current state. Use the below query in Commandshell as well as ISE.

Using AppMutex with silent Inno Setup

I'm using "AppMutex" in an Inno Setup script to make sure the product is not running anymore while installing an update. This basically worke fine.
But when running this setup with the "/verysilent" command parameter a dialog box is shown (although being very silent) that the program is still running and should be closed.
As the program itself is closed automatically and this may take only up to few seconds to be closed I just want Inno Setup to wait till the mutex was disposed and then start the installation, but not show any dialog box to the user in the meantime.
So is there a way to make Inno Setup just wait till the mutex was disposed when running with "/verysilent" and not show any dialog box about that to the user?
Thanks in advance for any suggestions on that!
There is no explicit way to suppress this message. However, you can suppress all the message boxes if you specify also the /SUPPRESSMSGBOXES parameter for the command line:
setup.exe /VERYSILENT /SUPPRESSMSGBOXES
If suppressing all the suppressible message boxes wouldn't fit to your requirements, you can wait for the mutex to be released (wait for your app. to terminate) by yourself in a loop with the CheckForMutexes function in an event fired before the setup performs this check.

Can eclipse notify me when a task has finished running?

I am often stuck twiddling my thumbs for a couple minutes while eclipse cleans, builds, or loads my projects. It would be nice if eclipse could notify me with a beep when the last task in the Progress view has finished running, so I can stop reading the internet and get back to work. Is there a setting or plugin that does this?
Edit: I tried adapting the plugin template that nonty provided below, which adds a listener to the JobManager. I tried implementing done() to beep only when the job change event's name contains "Building workspace," as that is the task that usually takes the longest in my setup. Exasperatingly, the task that builds the workspace never sends a done() call, just scheduled() and aboutToRun() calls. Any other ideas?
There are no preference for this - yet.
The JobManager have the needed API to support this functionality...
EDIT: I have constructed and attached a very simple plug-in that will beep for every job that terminates. That turns out to be rather often :-) . You can modify it to filter out all the false positives, e.g. by getPriority() and getName(). Also you can make the listener play a tune, popup a message (don't!) or whatever...
See jobnotifier.zip.
UPDATED the link above again