Skip to content

Issues running SetResolution.exe as a scheduled task. #11

Open

Description

@NabuTheWise

I'm with a school system that's trying to use your application as a scheduled task (we're trying to compensate for an issue between some classroom computers and the TV they're plugged into).

I've come across a problem running the application as a scheduled task. Originally, I thought it was an issue with running under the system account but in playing with things further, by using a local administrative account, it seems that the issue is more insidious.

For troubleshooting, I'm running a scheduled task with the following properties:

Program: CMD.EXE

Arguments: /C "C:\Program Files\SetResolution\SetREsolution.exe" SET -w 3840 -h 2160 -f 29 -noprompt > C:\TechDiv\Logs\SetResolution.log 2>&1

And that gives me the output to the log file of:

Set Resolution v0.2.1

(c) West Wind Technologies, 2022-2024

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Westwind.SetResolution.SetResolutionProcessor.SetResolution()
at Westwind.SetResolution.SetResolutionProcessor.Process()
at Westwind.SetResolution.Program.Main(String[] args)

If I instead run the following from an administrative command prompt:

"C:\Program Files\SetResolution\SetREsolution.exe" SET -w 3840 -h 2160 -f 29 -noprompt > C:\TechDiv\Logs\SetResolution.log 2>&1

I get this output:

Set Resolution v0.2.1

(c) West Wind Technologies, 2022-2024

Couldn't find a matching Display Mode.

Available Monitors

1 Generic PnP Monitor
2 Generic PnP Monitor * (Main)
3 Generic PnP Monitor

Available Display Modes (8)

1920 x 1200 *
1920 x 1080
1680 x 1050
1600 x 900
1600 x 1024
1440 x 1080
1280 x 720
1176 x 664

(And yes, I realize that this isn't a great test on my computer - I don't have the available resolutions, but it's also been failing to run on the type of stations that we ultimately want it running from.)

I'd also attempted running this as the .Net tool but the system account seemed to have trouble keeping it loaded. (I hadn't really gotten far into testing it as the tool since I'd noticed that it wasn't staying available.)

Thanks!

Nabu

Activity

  1. timrcm commented on Dec 20, 2024

    @timrcm

    Nabu,

    I'm successfully using this as a scheduled task for a project. What is your task's trigger? If it is upon user login, you will want to add a sleep/delay for a couple of seconds -- the task tries to run instantly before the GUI is fully rendered, and thus fails.

    I'm hoping to suggest a fix to handle this scenario more gracefully, but that is a functional workaround.

  2. NabuTheWise commented on Dec 20, 2024

    @NabuTheWise
    Author
  3. RickStrahl commented on Jan 5, 2025

    @RickStrahl
    Owner

    The display settings are user specific so if you running a scheduled task under an admin account, then that's not affecting the specific user's display settings.

  4. NabuTheWise commented on Jan 6, 2025

    @NabuTheWise
    Author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions