A series of problems caused by the shutdown command

Disclaimer: This article is a blogger original article, shall not be reproduced without the bloggers allowed. https://blog.csdn.net/masson32/article/details/47453629
    Today, I write a bat script to a key off, but found not double-click to run, but right-click Run as administrator, you can perform normally. How to make it run as administrator by default?
    After the online search, I need a computer - local users and groups management options, find local users and groups, modify administrator properties, but the question is, I can not find - right-click Properties. Use the command lusrmgr.msc in operation, it suggested that the operating system is wondows7 Home Basic, does not have this feature, the original version of the win7 home without this management function.
     The second question is, not how to solve win7 Home Edition "Local Users and Groups" problem. I want to start by what settings should be resolved, but not found, windows7 Ultimate must be installed in order to solve the problem is, because it is impossible to reinstall the system.

One problem: Windows7 Home Edition upgrade to Ultimate
    Find and again after practice round, found that windows7 Home Edition upgrade to Ultimate is simple (Baidu experience there http://jingyan.baidu.com/article/08b6a591ed82d314a809228d.html ), as follows:

1, click [Control Panel], [System and Security], select [] Windows Anytime Upgrade


2. Click [Windows Anytime Upgrade], select [Enter] key upgrade.

Internet looking for a bit key, I use the normal upgrade: 22TKD-F8XX6-YG69F-9M66D-PMJBM
3, wait for upgrades

      Waits during the upgrade system will automatically restart until finalized.
4, complete

     
     OK,操作系统已成功升级,再继续解决第一个管理员运行的问题。


问题二: 默认以管理员身份运行bat

1、在桌面的“计算机”鼠标右键“管理” 


2、在左侧的控制台树依次展开到“计算机管理(本地)——系统工具——本地用户和组——用户”


3、双击右边窗口中的名称为“Administrator”的账户 

这时打开了“Administrator 属性”的界面,在“常规”选项下将“账户已禁用”的勾去掉,这样就开启了Administrator(管理员)账户
注:以后打开任何程序都会默认以管理员的身份运行

4、在已写好的bat上鼠标右键“属性“

5、出现了该程序的属性窗口,我们将其切换到“兼容性”选项卡上 
6在特权等级栏下勾选“以管理员身份运行此程序”,单击“确定”

问题三:bat无法执行,只循环输出命令本身
    此时以为可以正常执行了,但是发现还是不行,双击bat脚本运行后,dos界面一直在重复命令输出,没有执行。
    由于我要做的事情很简单,就是一个关机命令:“shutdown -s -t 1”,直接在dos中输入此命令是可以正常执行,但是把它放在bat脚本那里则执行不了,只是不断输出命令本身,如下图所示:

     第三个问题来了,这是为什么,如何能让它点击可以正常运行。
     命令很简单,在dos中也可以直接运行,因此不是命令本身的问题,应该是脚本文件的问题,经过查找,发现是因为bat文件命名问题,bat文件名称不能以命令本身作为文件名称,否则会执行自身造成命令不断输出,无法正常执行。
    Since I had the bat file name is shutdown.bat, and command execution in the file is shutdown, and therefore the image above phenomenon continues to command output appears. Modify the file name for the myshutdown.bat, double-click the bat file again, successfully executed! After the shutdown simply double-click this file.
    These are the three issues a shutdown command caused, I get a few hours, and finally resolved, I hope to help people to experience this same problem.


Guess you like

Origin blog.csdn.net/masson32/article/details/47453629