Skip to main content


Showing posts with the label Task Scheduler

Access denied renaming shared folder

If you are working in a shared active directory environment and has a shared folder that needs to be renamed once in a while.
But every time you want to rename there is always a user who is using the folder and therefore, renaming the folder is denied.
How to rename the folder when the shared folder is always in use?
Automation will come for the rescue in such a scenario.
How to automate renaming the folder?
Task scheduler and a simple batch file can do the task and a life saver.
Here's how to do it:
Of course, disconnect all the open files. Users should shutdown their computers when they went out of the office,
If they don't shutdown, force their disconnection by using the command below:
openfiles /disconnect /o read/write openfiles /disconnect /o no access
Then, rename the folder with the ren or rename command of course.
Syntax is the good old fashioned source folder or path and the new folder name.
If the batch file will be run directly on the server, then the drive letter w…

Task Scheduler query last run result remotely

Check remote computer task scheduler results and settings via command line.

It's quite hard to check one by one each server or computer whether task scheduler has run successfully or not.

To make life easier, query the remote computer or server remotely and check task scheduler result.

One liner command below will list the task scheduler settings and also its results in a nice and readable format.

/v - is for verbose so it will include all settings and of course the last run result.

schtasks  /s /query /v

It would be better to have the result in a text file so it can be easily read and also keep for record purposes.

  schtasks  /s /query /v  > Machine01_Task_Result.TXT

The command above will not display the result on the command prompt but redirect the result to the text file.

Tested in Windows 2012 to query Windows 7 client.

Tested in Windows 7 to query another Windows 7 machine.

The command should be run with proper privileges in order for the query to be successful.


How to lock computer after inactivity

How to set Windows Task Scheduler

How to run task scheduler even if the user is not logged on?
How to set task scheduler via command line?
Example below are two methods on how to set Task Scheduler.
1.How to use the Graphical User Interface or the GUI on how to set task scheduler even if the user is not logged on.
2. How to use command line and use "Schtasks" command to set a task schedule.
In Windows Server 2008 or Windows 7, to run task scheduler type “Task” on the search text box and on the search result click on “Task Scheduler”.
In Windows 2012 or Windows 8, press the windows start key and type “Task” the Task scheduler will appear on the upper left of the search result.
On Windows 2012 or Windows 8 once you are on the start page, when a key is press on the keyboard it will automatically search for any programs that match the keys that has been typed.
To set a Task Scheduler on Windows 2008 even if the user is not logged on, please follow instruction and screen shot below.
Screen shot below should be t…