In Windows 7, due to User Account Control, using cmd is not very convenient because of permission issues. For example, the simplest thing, entering "net start mssqlserver" (to start the SQL Server service), will prompt "Access is denied". The simplest solution is to right-click and select "Run as administrator" to obtain permissions.
Now I find this is not convenient either, so I thought if there is any command that can achieve this effect. After checking, it's "runas".
Enter "runas /?" in cmd to view the help. Actually, all I need is to run with an administrator account. Enter "runas /user:administrator cmd" (run cmd with administrator), then it will ask for the password. After entering the password, an error occurs: "RUNAS error: Unable to run - cmd 1058: The service cannot be started. The reason could be that it is disabled or there is no associated device started."
This is because the "Secondary Logo" service is not started. This service is "Enable the startup process under different credentials". Directly enter services.msc in cmd, change the service from disabled to manual, then enter the runas command again, and a new cmd window will pop up, and it will run with the administrator account, and the permission issue is solved.
Now I find this is not convenient either, so I thought if there is any command that can achieve this effect. After checking, it's "runas".
Enter "runas /?" in cmd to view the help. Actually, all I need is to run with an administrator account. Enter "runas /user:administrator cmd" (run cmd with administrator), then it will ask for the password. After entering the password, an error occurs: "RUNAS error: Unable to run - cmd 1058: The service cannot be started. The reason could be that it is disabled or there is no associated device started."
This is because the "Secondary Logo" service is not started. This service is "Enable the startup process under different credentials". Directly enter services.msc in cmd, change the service from disabled to manual, then enter the runas command again, and a new cmd window will pop up, and it will run with the administrator account, and the permission issue is solved.
Recent Ratings for This Post
( 1 in total)
Click for details
| Rater | Score | Time |
|---|---|---|
| zzz19760225 | +2 | 2017-08-13 08:46 |
