Sei sulla pagina 1di 18

Windows Run and Command Line Commands

Operating Systems Laboratory Amir Saman Memaripour

Outline
Windows run commands Windows command line commands

Windows Run Commands


Chapter One

Command Line Commands


Chapter Two

Schedule Tasks
At command, as the name indicates, can be used to schedule applications at specified time and date. This is a built-in command in Windows OS and does not require any separate software to be installed on the computer.

Schedule a task at a
particular time

Schedule a Recurrent
Task

See the tasks scheduled Schedule a task on some


other day

Schedule tasks to run


every day

Delete Scheduled Tasks

Schedule a Task at a Particular Time


To schedule a task we just need to specify the time and the command for the task we need to run. For example, if you want to shutdown your computer at 11PM today then you can do this by running the below command.

At 11:00:00PM shutdown -r

Schedule a Recurrent Task


We can schedule tasks that run recurrently once in a week or once in a month. We can use/every switch for this purpose. Lets say you want to automatically run defragmentation on one of the drives once in every week. This can be done by running the below command

At 10:00:00AM /every:Monday defrag c:

See the Tasks Scheduled


We can see the list of scheduled tasks just by running At command without any parameters.

C:\>at Status ID Day Time Command Line -----------------------------------------------1 Each M 10:00 AM defrag c:

Schedule a Task on Some Other Day


We can use /next switch to schedule tasks for a different day. For example to run defragmentation on C: drive on next Thursday you can run the below command.

At 11:00:00AM /next:Thursday defrag c:

Schedule tasks to run every day


Using /every switch we can schedule a task to be run every day. For example to shutdown your computer automatically every day at 11PM you can create a task using the below command.

At 10:00:00AM /every:M,T,W,TH,F,SA,SU shutdown -r

Delete Scheduled Tasks


We can delete scheduled tasks from the database by using /delete switch. We need to pass the id of the task we need to delete. We can see the id for each task by running At command without any parameters. For example to delete the task with the id 1 we need to run the below command.

At 1 /delete

Set file attributes from command line


We can use attrib command to set/unset file attributes. Let us see how to use this command to manipulate different file attributes from windows command line(CMD). Take a sample file example.doc

Archive attribute Read only attribute Hidden attribute System file attribute

Archive Attribute
To set archive attribute for the file example.doc:
attrib +a example.doc

To unset archive attribute:


attrib -a example.doc

Read only Attribute


To set read only attribute:
attrib +r example.doc

To unset read only attribute:


attrib -r example.doc

Hidden Attribute
To make the file hidden :
attrib +h example.doc

To remove the hidden attribute:


attrib -h example.doc

System file Attribute


To set system file attribute:
attrib +s example.doc

To unset system file attribute:


attrib -s example.doc

Copy command
Using copy command, we can copy files from one directory to another directory. This command is similar to the Linux cp command, but it does not match with the full functionality of cp. Windows copy command can be used to copy files only, we cant copy directories.

Potrebbero piacerti anche