I'm using Windows 10. When I first login, I launch a command window using
cmd
and then run a service using
myserv -a
I would like all this to happen automatically after I login. How do I configure this in Windows 10 when I am not an admin user?
First, you need to create a batch file for your commands. Here are the steps to do it:
New > Text Document
.@echo off
cd "C:\Path\to\folder"
cmd /c "myserv -a"
File > Save As
, change the Save as type
to All Files
, and save it with any name but with an extension of .bat
(for example, autoStart.bat
).IF ADMIN REQUIRED SKIP STEPS #2 and #3 see below for admin privileges
To make this batch file run automatically when you log in, you have to place it in the Startup
folder. Here are the steps to do that:
WIN+R
to open the Run
dialog box.shell:startup
and hit Enter
to open the Startup
folder.Now, every time you log in to your Windows 10, the batch file will run automatically, which, in turn, will run cmd and then your service.
Since the service you're trying to run requires elevated privileges, it may be best to request that an admin user set up the automatic task, or grant your user account the necessary permissions.
Admin users can setup tasks with elevated privileges via the Task Scheduler:
Start
> Windows Administrative Tools
> Task Scheduler
).Create Basic Task
.Name
and Description
then click Next
.When I log on
then click Next
.Start a program
then click Next
.Browse
to find and select your batch file. Then click Next
and Finish
.Properties
.General
tab, check Run with highest privileges
.OK