New answers tagged

1

Delete non-valid entries from the TaskCache. The TaskCache is normally maintained automatically, in this case some entries were not removed automatically when the task was deleted. Search in registry and manually delete any keys that contain the non-valid scheduled task name that are found in: HKLM\SOFTWARE\Microsoft\Windows ...


1

Is there any way to retrieve Status only? Use the following command: for /f "usebackq skip=3 tokens=4" %a in (`schtasks.exe /query /tn "GoogleUpdateTaskMachineUA"`) do @echo %a Notes: skip=3 - ignore the header lines tokens=4 - grab the 4th token (the value in the status column) To use in a batch file, replace %a with %%a Example usage: ...


1

Unless you really have to use schtasks.exe, use PowerShell with all its superior output and formatting options: Get-ScheduledTask | ? TaskName -eq GoogleUpdateTaskMachineUA | Select State | ft -AutoSize or (Get-ScheduledTask | Where TaskName -eq GoogleUpdateTaskMachineUA ).State


-1

Add /fo csv to the schtasks command to change its output format to CSV. Then use CSVFix to filter the required column with -f 3 argument and skip the field-name record with -ifn. schtasks.exe /query /tn "GoogleUpdateTaskMachineUA" | csvfix order -ifn -f 3


0

Easiest way is to use the Task Scheduler MMC snap-in. You can type "Task Scheduler" in the Cortana search box or run mmc.exe and add the snap-in manually. Once you get the GUI, just right-click on the task and choose "disable" - it's still there, just hidden :) I'm not sure why the command line has changed - weird...


3

Use Powershell! Disable-ScheduledTask -TaskName "Adobe Flash Player Update" TaskPath TaskName State -------- -------- ----- \ Adobe Flash Player Updater Disabled EDIT: with ...


1

Run a task once a day at log on I am trying to set up a schedule task to run an exe exactly once a day. I am considering writing a batch script that will write out to a file and be able to detect if it's been called before. Okay, so the below is an example with very basic and simple batch script logic as you stated in the comment may be ...


0

Drop the .exe in one of the following folders to run it when the computer boots up. You won't have to do anything in Task Scheduler. For just the current user: C:\Users\username\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup For all users: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup Hope this helps!


2

How do I connect to the same WiFI network after some hours? Use netsh wlan connect name=wifi_profile_name in a batch file. Replace wifi_profile_name with the name of the profile to be used Schedule a task using the built-in task scheduler taskschd.msc to run the batch file at the time you want to connect: Click "Start" Type Task and then click "Task ...


1

When you run things in the Task Scheduler, the working folder (by default) is %windri%\system32. So any files created by the task, that don't have a path specified, will be written there (or at least it will attempt to write them there). To avoid this, specify an absolute path in your SET logfilename_sp_fix="SPSearchFix.log" line. E.g.: SET ...


1

You can use schtasks and provide the task user credentials. I use this regularly in my PowerShell scripts schtasks.exe /create /s NAMEOFCOMPUTER /ru DOMAIN\USER /rp PASSWORD /tn NAMEOFTASK' /XML PATHTOXMLFILE


0

In my case I was using a mapped drive as a destination, but the drive wasn't mapped in the context of the script (user logged off), so I had to map the drive inside the script before I could use that mapping. Example: @echo off net use Z: \\server\share /u:domain\username *password* robocopy c:\folder Z:\backup /o /p /t /i /o /n /s


0

Quick and dirty solution: Find an appropriately protected folder in which a "workstation lock file" can be created that other .bat files can test the existence of. Create a file createLockFile.bat in this folder containing the following code: @echo off @echo "" > WORKSTATION_IS_LOCKED Create another file deleteLockFile.bat in this folder containing ...


0

I believe that the best place to do that is in visual Studio, not in task scheduler. I could tell you how to do it with task scheduler, but it would be a real hack. There are two ways to do it with Visual Studio. One is to use Visual Studio to create a "makefile" to do your build, then edit the make file and add "shutdown.exe" with appropriate options as ...


1

You can write a PowerShell script and have Windows Task Scheduler run it every 2 hours A quick and dirty example script: # Declare variables $db = "[DB NAME]" $user = "[DB USERNAME]" $pw = "[DB PASSWORD]" $date = (Get-Date).ToString("yyyy-MM-dd_HH.mm.ss") $mysql_backupfile = ".\backup_$date.sql" $zipped_backupfile = "$mysql_backupfile.zip" # Backup MySql ...


0

I am using Wake On LAN (WOL) feature on my computer so that I can wake up my computer remotely if I need to access it while I am away.. in order for WOL to work is that I have to allow my network card to wake the computer when I send the WOL magic packet. This is somehow causing my computer to wake up randomly for no apparent reason. To know whether this is ...


1

I had a similar case, and it seems that task scheduler treats the "start in" option differently whether you run it manually or on system startup. My "start in" was not defined. It wasn't until I properly set it up to start my script in the desired location that I was able to reproduce the same behaviour regardless of whether I was running on startup or ...



Top 50 recent answers are included