Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Filter by
Sorted by
Tagged with
1 vote
0 answers
88 views

Powershell script using Microsoft.Graph in Task Scheduler - prompt for login every time its executed

I'm trying to run a ps1 script using Task Scheduler. The script uses Connect-MgGraph from Microsoft Graph PowerShell SDK and the Azure app has delegated permissions. While testing the script manually,...
Patryk's user avatar
  • 33
0 votes
1 answer
73 views

Task not deleted immediately after Unregister-ScheduledTask

Problem When you delete a task with Unregister-ScheduledTask and then immediately register a new task with the same name, Register-ScheduledTask will throw an error like this: PS C:\> $Name = "...
SATO Yusuke's user avatar
  • 2,304
1 vote
0 answers
62 views

How to connect to Remote PC to read Task Scheduler Status for each job?

I have two PCs that I am trying to connect so I can look at each Task Job Status in Task Scheduler. So I was able to use following code: public void Taskreader(string machineIP, string user, string ...
NeoGenesis521's user avatar
1 vote
1 answer
125 views

How to add a VBScript command that renames an Excel File with the previous workday's date to existing VBScript code [duplicate]

I already have a VBA string that is used by Task Scheduler to open a certain workbook "ORCA Refresh" every day. It refreshes all sheets then closes the document. I need to add a command to ...
user avatar
1 vote
1 answer
109 views

ps1 script not performing consistently with task scheduler

lets say I have a myScript.ps1 file, that at some point needs to run native commands/binaries. its content is: set-content -path "c:\temp\test.text" -value "hello world" . 'C:\temp\...
Ralf_Reddings's user avatar
0 votes
0 answers
27 views

How do I get python script which is dependent on an env. file to run in task scheduler?

I have a python script via jupyter notebook that runs fine in jupyter notebook. It relies on an env. file. How do I ensure that env. is also running if I use task scheduler. I drop the env file in the ...
Kofisam's user avatar
0 votes
1 answer
213 views

Windows activates task before user logon although trigger is set as "At log on"

I want my Win11 c# program to get activated automatically when user logs in. I didn't find anything documented for this behavior, but I verified using logs that Windows is running the program very ...
ishahak's user avatar
  • 6,845
0 votes
0 answers
60 views

Retrieving outlook attachments using MSAL library instead of ADAL using powershell

I am trying to replace a colleague's PowerShell script that goes into an outlook email and downloads attachments, then saves them. This is what I currently have and it works when run manually but ...
Milan Patel's user avatar
0 votes
2 answers
70 views

Notification after shut down on windows using python

I want to create a function that displays a message for the user when windows start again after a shutdown. It is used together with the shutdown command shutdown \s \hybrid Heres my attempt with the ...
Electron X's user avatar
2 votes
0 answers
49 views

Windows task scheduler triggers the task but it is not invoking the app which I want to open on system login

I have an electron app through which I want to schedule a task on windows. The task I want to perform is to trigger an my electron app with admin access on system restart. This is my code const { exec ...
NJT's user avatar
  • 31
0 votes
0 answers
17 views

How to create a task that will be launched when any user logs in Windows

I have the following xml file which defines the settings for a windows task. <?xml version="1.0" encoding="UTF-16"?> <Task version="1.2" xmlns="http://...
Diane's user avatar
  • 31
0 votes
0 answers
69 views

Python program runs fine in terminal but will not run in windows scheduled task

I'm trying to figure out why my python script will not run in Windows Task Manager. I've scheduled many tasks including even tasks that restart windows, but this problem has me baffled. Here is the ...
Steve's user avatar
  • 19
0 votes
0 answers
331 views

Windows Scheduler Task missed start task rejected mechanism

Can someone explain to me the mechanism of how the Windows Scheduler Task checks for a "missed task start rejected"? This morning, when I checked the scheduler task history, I saw a warning ...
Nguyen Tung Son's user avatar
-1 votes
1 answer
156 views

Executing of compiled cs file with csc command fails with error "Could not load file or assembly System.Runtime or one of its dependencies"

I have to make a WPF apllication which adding a task to Task scheduler. So I decided to write a program which compiling cs file and add its exe to Task scheduler (I tried Microsoft.CodeAnalysis.CSharp....
Adrian Przemysław Drozdowski's user avatar
0 votes
2 answers
189 views

How to keep queue:work running continuously in Windows Task Scheduler even when the job queue is empty?

I’m working with a Laravel project and I need to run the php artisan queue:work command continuously, even when there are no jobs in the queue. I have already set up a Windows Task Scheduler task to ...
Stevani Putri's user avatar
0 votes
2 answers
348 views

Why is this excel macro failing to run non-interactively via task scheduler since a windows update

I have a bat file, that executes a vbscript, that runs an excel macro (I'm using Excel 2016). This is running on a Windows Server. Everything worked ok for years until the server was upgraded from ...
Daniel's user avatar
  • 71
-1 votes
1 answer
86 views

Why does a batch file work fine on execution with double click but fails on execution as scheduled task?

I am using the following as a backup for all open folder windows when Windows crashes. It works well when I click on it in Windows File Explorer. It creates the batch file foldersession.bat that can ...
user3498033's user avatar
0 votes
0 answers
186 views

The handle is invalid exception while capturing screen using Graphics.CopyFromScreen() on the remote server via Task Scheduler

I have a C# stand-alone (EXE) application, that does some data processing. At the end of the process, program takes a screenshot, saves the image (PNG) to a local folder and exits. When I run this ...
idelin's user avatar
  • 23
-2 votes
1 answer
75 views

Task Scheduler not running after restart of VPC

I have 1 app that runs 24x7. I have configured Task Scheduler Task to Run the App at Logon and At Startup for Any User. This all works perfectly on PC. But on VPC the system was restarted and the App ...
Anup's user avatar
  • 9,774
2 votes
1 answer
104 views

Adding task using Interface 1.0 Win32 API doesn't show up in the Task schedular GUI

I was trying to run the sample program, taken from the Microsoft docs. Seems the is being created (.job file found in the C:\Windows\Tasks) but it is not listed on Task schedular GUI. Is this related ...
NImIPKZvUc's user avatar
0 votes
0 answers
349 views

How to capture Task Scheduler logs from Event Viewer remotely

I am looking into capturing the event levels with information whether they are information/error/warning. So, I started to look into the WMI to access the PC remotely and it was able to connect to the ...
user avatar
2 votes
0 answers
86 views

Task Scheduler Script on startup not setting enviroment variables

I wish to run pico-env.cmd on Windows Start-up to set up development environment for my Raspberry Pi Pico. I've configured this in Task Scheduler to run at startup as administrator. The task is ...
Dark Sorrow's user avatar
  • 2,039
0 votes
0 answers
287 views

Invoke-Sqlcmd is not available from within powershell script

I am not able from within .ps1 script call function Invoke-Sqlcmd. This script is: Install-Module -Name SqlServer Invoke-Sqlcmd -ServerInstance "SQLSERVER\" -Database "MYDB" -Query ...
LDonSOvrfw's user avatar
1 vote
0 answers
84 views

ITaskScheduler::NewWorkItem fails with E_ACCESSDENIED

What permission should a user have to create a new work item in Task Scheduler? Also, how to check if any GPOs are restricting the creation of the work item in Task Scheduler. Edit: Tried adding ...
NImIPKZvUc's user avatar
0 votes
1 answer
75 views

Is there a way for python to update an excel slicer in non-interactive mode?

I have a python script that refreshes data connections, updates slicers and filters. I'm using pywin32 to update my excel file. As I understand, updating excel slicers and filters requires COM ...
intransigent_rocker's user avatar
1 vote
0 answers
260 views

Get-ScheduledTask only shows full results after piping to Get-ScheduledTaskInfo

I am trying get a list of all the Windows Task Scheduler tasks, to be later filtered by their Action. I noticed in Both Windows PowerShell and Powershell ISE when running Get-ScheduledTask I only get ...
Elior Machlev's user avatar
0 votes
1 answer
90 views

Curl - Call endpoints in pairs not one by one

I have my scripts endpoints running on localhost(http://127.0.0.1:5001). What I have: What I currently do is calling those scripts (endpoints) one by one in a loop from .bat file (I use windows task ...
Andurit's user avatar
  • 5,802
-2 votes
1 answer
90 views

How to handle the spaces in a command which is set in the Task Scheduler in batch file? [closed]

I am trying to set a task schedule to execute the command which installs the Python packages. However, the path of packages contains some space. I tried many way but could not get a good solution. The ...
DuyXike's user avatar
  • 11
0 votes
1 answer
158 views

Schtasks - Error: The parameter is incorrect. (14,8): UserId:

I am working on a script to automate the ability to use schtasks to test managing remote Windows Scheduled Tasks. I have a specific test task that I created on another server. I am able to query ...
sbagnato's user avatar
  • 538
0 votes
0 answers
105 views

Windows Task Scheduler: run .py script without window opening

I have been asked to run a python script from the Windows Task Scheduler. In my python script I will substantially use watchdog library in order to instanciate and run an Observer that will monitor ...
Fra B's user avatar
  • 13
1 vote
1 answer
71 views

Schedule task on Second Sunday of the month or on Third and Fourth Sunday and Saturday

I'm using C# and Microsoft.Win32.TaskScheduler.dll to create dynamic scheduled tasks. No problem to set a date for a specific scheduled Month date : TaskService ts = new TaskService(); TaskDefinition ...
Le ZVince's user avatar
1 vote
0 answers
60 views

Way to Automate Opening and Closing a Word Doc At Same Time Every Day? (Task Scheduler VBA Script Not Working) [duplicate]

I have tried Task Scheduler, but I can't stop getting the error ActiveX can't create component on line 3: Dim WordApp Dim Doc Set WordApp = CreateObject("Word.Application") Set Doc = ...
Christian Nelson's user avatar
0 votes
1 answer
286 views

Powershell: set new task under taskscheduler from Intune

I need to use powershell script to set schedule task. The test users has an admin rights and running manually works on user's test pc, creates the scheduled task. However the other users doesnt have ...
Akos81's user avatar
  • 1
0 votes
0 answers
85 views

Why does my script's output change when run manually vs via task scheduler

While my script runs both ways, when run through task scheduler, it messes up on an if-else statement. It's supposed to send out an email when it detects that there are fewer than three objects in a ...
Avarsiral's user avatar
-1 votes
1 answer
236 views

How to skip winSCP asking for credentials in automated script?

I am new to using winSCP and Windows Task Scheduler. I am working on connecting to an external FTP server and copying its contents to a local directory on my PC. When running my scheduled task, winSCP ...
Fire7665's user avatar
0 votes
0 answers
90 views

How to invoke a script with admin rights through another script

My company is in the process of reorganizing all windows scheduler tasks that utilize PowerShell scripts. For security reasons, we are no longer allowed to use an admin domain account to call the ...
MirrahOH's user avatar
0 votes
0 answers
87 views

How do I monitor Windows Scheduled Task for failure through console c#?

My requirement is For a specific Task, I need to get these details: 1.Last started Datetime and Last Completed Datetime 2.Errors details if any within this instance. 3.Events details. This code I have ...
KamalaH's user avatar
  • 1,411
0 votes
1 answer
38 views

Where can status reports made via `ITaskHandlerStatus` be accessed?

When implementing ITaskHandler for a Windows Scheduled Task implemented by a COM Server, one is given access to ITaskHandlerStatus to update status and report completion. Completion is required and ...
Mitch's user avatar
  • 22.6k
0 votes
1 answer
123 views

How to run a task on windows 11 session opening ... but only once a month

I need a task to be performed once a month. BUT I cannot use the trigger "start the task every 1st of month at 8:00" (for example) because, maybe, the computer won't be turned on at 8:00 for ...
M'sieur Toph''s user avatar
0 votes
0 answers
49 views

How can I implement web traffic blacklisting through etc/hosts file in windows?

I am creating a web traffic blacklisting feature for a MDM product in windows through powershell script run by python. What I am trying to achieve is, when a domain name and username is given in the ...
RAHUL JHA's user avatar
0 votes
1 answer
126 views

Schtasks does not provide full access to the program

I wrote a small code in C, and want to try to run it through Schtasks. It started, but a winapi function, which requires administrator rights, did not work. For cmd, I use this prompt (I launched it ...
Koalko 833's user avatar
0 votes
0 answers
205 views

Windows Task Scheduler not working with 'Run whether user is logged on or not'

Context At my workplace, there is a webserver which uses task scheduler. In the morning, three scripts run which pull data from SAPGUI & SQL and uploads it into an Excel sheet. Once the task ...
Johnboy's user avatar
  • 11
0 votes
0 answers
32 views

PowerShell script fails when run through Windows Task Scheduler on one machine

We have one machine where running a task in task scheduler doesn't work. It's running a PowerShell script that checks for write protections on a excel file and the runs a macro. If I run the script ...
Rasmus Thorslund's user avatar
0 votes
0 answers
54 views

Why can't my .NET app see a network share when run from Task Scheduler?

I have an executable written in C# that looks in I:\contracts, which is a network share. If I run it manually in PowerShell it works as expected. However, if I set it up as a task in Task Scheduler, ...
Darrell Brogdon's user avatar
0 votes
0 answers
129 views

Python script in "Task Scheduler" runs forever

I can't figure out why my Python script works perfectly in the console when I execute it like this (runs for 1-2 seconds): But if I run it in the task scheduler (either manually or at the scheduled ...
NaturalBornCamper's user avatar
0 votes
1 answer
119 views

Time difference between two events using powershell script

I'm not a developer, but for administrative purposes, I need to make a script that will return the execution time of a task from the Task Scheduler in Windows. My idea was to first filter the Event ...
TomMe's user avatar
  • 1
0 votes
1 answer
38 views

Cannot launch an executable from a .ps1 itself being lunch from the Windows Task Scheduler

I created a .ps1 file that verify if a process is running and if not, it launches the program. This .ps1 file is launched every 10 minutes by the Windows Task Scheduler. I cannot use the Task ...
Strix's user avatar
  • 1
0 votes
0 answers
63 views

Running Python Script via Task Scheduler returns weird characters in JSON File

I'm running a Python Script ("run whether user is logged on or not") on Windows Server 2016 every hour. The Python Script basically just calls an API and exports the results into the JSON ...
ltuandy's user avatar
0 votes
0 answers
170 views

Windows Task Scheduler & Selenium run issue

I am using Selenium to do some key clicking to choose a specific VPN from the VeePn Extension for Chrome. Everything works fine when I run the Python script manually, because it opens up the browser. ...
Alexis's user avatar
  • 37
3 votes
1 answer
1k views

How to repeat tasks every 1 minute in Windows 11 task scheduler? [closed]

I have a C# console application that must be run every minute to check data, therefore I use a task scheduler. However, the time available to repeat the task is limited in the Windows 11 task ...
Wahyu Arya Pambudi's user avatar

1
2 3 4 5
19