Upload
amir-saman-memaripour
View
243
Download
4
Embed Size (px)
Citation preview
7/31/2019 Windows Run and Command Line Commands
1/18
Windows Run andCommand Line
CommandsOperating Systems Laboratory
Amir Saman Memaripour
7/31/2019 Windows Run and Command Line Commands
2/18
Outline Windows run commands
Windows command line commands
7/31/2019 Windows Run and Command Line Commands
3/18
Windows Run CommandsChapter One
7/31/2019 Windows Run and Command Line Commands
4/18
Command Line CommandsChapter Two
7/31/2019 Windows Run and Command Line Commands
5/18
Schedule Tasks Schedule a task at a
particular time
Schedule a RecurrentTask
See the tasks scheduled
Schedule a task on someother day
Schedule tasks to runevery day
Delete Scheduled Tasks
At command, as the nameindicates, can be used to scheduleapplications at specified time anddate. This is a built-in command inWindows OS and does not requireany separate software to beinstalled on the computer.
7/31/2019 Windows Run and Command Line Commands
6/18
Schedule a Task at a ParticularTime
To schedule a task we just need to specify the time andthe command for the task we need to run. For example,if you want to shutdown your computer at 11PM todaythen you can do this by running the below command.
At 11:00:00PM shutdown -r
7/31/2019 Windows Run and Command Line Commands
7/18
Schedule a Recurrent TaskWe can schedule tasks that run recurrently once in a
week or once in a month. We can use/everyswitch forthis purpose. Lets say you want to automatically rundefragmentation on one of the drives once in every
week. This can be done by running the belowcommand
At 10:00:00AM /every:Monday defrag c:
7/31/2019 Windows Run and Command Line Commands
8/18
See the Tasks ScheduledWe can see the list of scheduled tasks just by
running Atcommand without any parameters.
C:\>at
Status ID Day Time Command Line
------------------------------------------------1 Each M 10:00 AM defrag c:
7/31/2019 Windows Run and Command Line Commands
9/18
Schedule a Task on SomeOther Day
We can use /next switch to schedule tasks for a differentday. For example to run defragmentation on C: drive onnext Thursday you can run the below command.
At 11:00:00AM /next:Thursday defrag c:
7/31/2019 Windows Run and Command Line Commands
10/18
Schedule tasks to run everyday
Using /every switch we can schedule a task to be runevery day. For example to shutdown your computerautomatically every day at 11PM you can create a taskusing the below command.
At 10:00:00AM /every:M,T,W,TH,F,SA,SU shutdown -r
7/31/2019 Windows Run and Command Line Commands
11/18
Delete Scheduled TasksWe can delete scheduled tasks from the database by
using/deleteswitch. We need to pass the id of the taskwe need to delete. We can see the id for each task byrunning At command without any parameters. For
example to delete the task with the id 1 we need to runthe below command.
At 1 /delete
7/31/2019 Windows Run and Command Line Commands
12/18
Set file attributes
from command line
Archive attribute
Read only attribute
Hidden attribute
System file attribute
We can use attrib command toset/unset file attributes. Let us seehow to use this command tomanipulate different file attributesfrom windows command line(CMD).Take a sample file example.doc
7/31/2019 Windows Run and Command Line Commands
13/18
Archive Attribute To set archive attribute for the file example.doc:
attrib +a example.doc
To unset archive attribute:
attrib -a example.doc
7/31/2019 Windows Run and Command Line Commands
14/18
Read only Attribute To set read only attribute:
attrib +r example.doc
To unset read only attribute:
attrib -r example.doc
7/31/2019 Windows Run and Command Line Commands
15/18
Hidden Attribute To make the file hidden :
attrib +h example.doc
To remove the hidden attribute:
attrib -h example.doc
7/31/2019 Windows Run and Command Line Commands
16/18
System file Attribute To set system file attribute:
attrib +s example.doc
To unset system file attribute:
attrib -s example.doc
7/31/2019 Windows Run and Command Line Commands
17/18
Copy commandUsing copycommand, we can copyfiles from one directory to anotherdirectory. This command is similarto the Linux cp command, but itdoes not match with the fullfunctionality of cp.Windows copy command can beused to copy files only, we cantcopy directories.
7/31/2019 Windows Run and Command Line Commands
18/18