-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathWinAddTask.html
163 lines (149 loc) · 6.52 KB
/
WinAddTask.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<html>
<title>
CIFS-over-SSH: Add task using Task Scheduler
</title>
<body>
<h1>Add a task to start Windows drivers using the Task Scheduler
</h1>
<h2>Introduction</h2>
This page is part of the CIFS-over-SSH tutorial for Windows 7, 8 and 10. You are reading this
most likely because some necessary Windows drivers did not start automatically after following
the tutorial.
<br>
In this section, we will add a task using the Windows Task Scheduler to launch those drivers
at system startup time.
This part of the tutorial is split into the following parts:
<ul>
<li>Create a <a href="#CreateSmbTask">task</a> to start the 'SMB' driver, mostly for Windows 7.
</li>
<li>Create a <a href="#CreateLanManServerTask">task</a> to start the 'LanmanServer' driver, mostly for Windows 8+.
</li>
<li>Note that some users have problems to make these tasks persistent. Chris Clifton reported that he had
to create <b>TWO</b> tasks to first <code>disable</code> the LanmanServer driver and then secondly
<code>enable</code> it again. So the first task follows the same procedure as above, but using
<pre>
sc config LanmanServer start= disabled
</pre>
followed by a second task with
<pre>
sc config LanmanServer start= delayed-auto
</pre>
YMMW, and let me know what works for you.
</li>
</ul>
<h2><a name="CreateSmbTask">Creating a task to start the 'SMB' driver</a></h2>
Of course, now that we have disabled the automatic startup of the 'SMB' driver
we need to start it manually when Windows comes up, or rather, when a user
logs in. For this we use the Windows Task Scheduler:
<ul>
<li>Start the 'Task Scheduler' from the 'Administrative Tasks' menu:
</li>
<li>Click on 'Create Basic Task' to use the Task Wizard. A new window will
come up:<br>
<img src="images/VistaBasicTask1.png" alt="CreateTask1">
<br>Enter the name of the task, e.g. <b>Start SMB driver</b>
and click <b>Next</b>.
</li>
<li>Choose an event to trigger the execution of the task. We will change this
later on, so for now, choose <b>When I log in</b>:<br>
<img src="images/VistaBasicTask2.png" alt="CreateTask2">
<br>and click <b>Next</b>.
</li>
<li>Next we need to choose the type of action:<br>
<img src="images/VistaBasicTask3.png" alt="CreateTask3">
<br>Select the entry <b>Start a program</b> and click <b>Next</b>.
</li>
<li>Fill in the details of the program we want to start:<br>
<img src="images/VistaBasicTask4.png" alt="CreateTask4">
<br>
<ul>
<li>The <b>Program</b> is '<code>c:\windows\system32\net.exe</code>'
</li>
<li>The <b>Arguments</b> are '<code>start smb</code>'
</li>
</ul>
Then click <b>Next</b> to continue.
</li>
<li>Before clicking 'Finish' first select the tickbox 'Open the properties dialog':<br>
<img src="images/VistaBasicTask5.png" alt="CreateTask5">
<br>and then click <b>Finish</b>.
</li>
<li>In the 'Task Properties' window select <b>Run whether user is logged on or not</b>, then
select <b>Do not store password</b>. After that, also select the tickbox
<b>Run with highest privileges</b>:<br>
<img src="images/VistaTaskPropertiesGeneral.png" alt="TaskPropsGeneral">
<br>Do <b>NOT</b> click 'OK' just yet, but go to the 'Triggers' tab, then double-click
the 'At log on' trigger to edit it.
</li>
<li>In the 'Edit Trigger' window change the setting 'Specific user or group' to
<b>Any user</b>:<br>
<img src="images/VistaTaskPropertiesTrigger.png" alt="TaskPropsTrigger">
<br>then go to the 'Conditions' tab:
</li>
<li>In the 'Conditions' window make sure the setting '<b>Start the task only if the computer
is on AC power</b>' is <b>NOT</b> set:<br>
<img src="images/VistaTaskPropertiesConditions.png" alt="TaskPropsConditions">
<br>and then click <b>OK</b>.
</li>
</ul>
The task is now configured. Close the Task Scheduler and reboot to verify that the driver now
starts at system bootup time.
<h2><a name="CreateLanmanServerTask">Creating a task to start the 'LanmanServer' driver</a></h2>
Of course, now that we have disabled the automatic startup of the 'LanmanServer' driver
we need to start it manually when Windows comes up, or rather, when a user
logs in. For this we use the Windows Task Scheduler:
<ul>
<li>Start the 'Task Scheduler' from the 'Administrative Tasks' menu:
</li>
<li>Click on 'Create Basic Task' to use the Task Wizard. A new window will
come up:<br>
<img src="images/VistaBasicTask1.png" alt="CreateTask1">
<br>Enter the name of the task, e.g. <b>Start LanmanServer driver</b>
and click <b>Next</b>.
</li>
<li>Choose an event to trigger the execution of the task. We will change this
later on, so for now, choose <b>When I log in</b>:<br>
<img src="images/VistaBasicTask2.png" alt="CreateTask2">
<br>and click <b>Next</b>.
</li>
<li>Next we need to choose the type of action:<br>
<img src="images/VistaBasicTask3.png" alt="CreateTask3">
<br>Select the entry <b>Start a program</b> and click <b>Next</b>.
</li>
<li>Fill in the details of the program we want to start:<br>
<img src="images/Win8BasicTask4.png" alt="CreateTask4">
<br>
<ul>
<li>The <b>Program</b> is '<code>c:\windows\system32\svchost.exe</code>'
</li>
<li>The <b>Arguments</b> are '<code>-k netsvcs</code>'
</li>
</ul>
Then click <b>Next</b> to continue.
</li>
<li>Before clicking 'Finish' first select the tickbox 'Open the properties dialog':<br>
<img src="images/VistaBasicTask5.png" alt="CreateTask5">
<br>and then click <b>Finish</b>.
</li>
<li>In the 'Task Properties' window select <b>Run whether user is logged on or not</b>, then
select <b>Do not store password</b>. After that, also select the tickbox
<b>Run with highest privileges</b>:<br>
<img src="images/VistaTaskPropertiesGeneral.png" alt="TaskPropsGeneral">
<br>Do <b>NOT</b> click 'OK' just yet, but go to the 'Triggers' tab, then double-click
the 'At log on' trigger to edit it.
</li>
<li>In the 'Edit Trigger' window change the setting 'Specific user or group' to
<b>Any user</b>:<br>
<img src="images/VistaTaskPropertiesTrigger.png" alt="TaskPropsTrigger">
<br>then go to the 'Conditions' tab:
</li>
<li>In the 'Conditions' window make sure the setting '<b>Start the task only if the computer
is on AC power</b>' is <b>NOT</b> set:<br>
<img src="images/VistaTaskPropertiesConditions.png" alt="TaskPropsConditions">
<br>and then click <b>OK</b>.
</li>
</ul>
The task is now configured. Close the Task Scheduler and reboot to verify that the driver now
starts at system bootup time.
</body>
</html>