DOS Common commands

Source: Internet
Author: User

DOS command


New users:

@echo off

NET user username "password"/add

Pause


To delete a user:

@echo off

NET user Username/del

Pause


To set the user as an administrator:

@echo off

net localgroup Administrators Username/add

Pause


To set the user as non-administrator:

@echo off

net localgroup Administrators Username/del



change user name:

@echo off

Echo Current user name:%USERNAME%

set/p user= Please enter the user name you want to change:

set/p newuser= Please enter a new user name:

WMIC useraccount where name= '%user% ' call Rename%newuser%

Pause


change user password:

@echo off

NET user username password

Pause


Clear User password:

@echo off

NET user username ""

Pause


Logout system:

@echo off

shutdown/l


Timer shutdown:

@echo off

Shutdown-s-T 300


To cancel a timer setting:

@echo off

Shutdown-a


Restart the system:

@echo off

Shutdown-r


To view native system processes:

@echo off

Tasklist

Pause


To view remote system processes:

@echo off

tasklist/s ipaddress/u username/p Password

Pause


To terminate a program process:

@echo off

taskkill/f/im "Process name"

Pause


7z Compression:

@echo off

7z a E:\archive.zip e:\*.txt

Pause


7z Decompression:

@echo off

7z x e:\archive.zip-oe:\

Pause


Note: 7-zip function is very powerful, after installing the software, it is necessary to copy the 7z.exe and 7z.dll files under the installation directory to the C:\Windows\System32 directory;


New folder:

@echo off

Set Nginxbackupdir=d:\backup\nginx

MD%nginxbackupdir%\%date:-=%

MD D:\backup\folder

Pause


To delete a folder:

@echo off

RD/S/q D:\backup\folder

Pause


Backup data:

@echo off

xcopy/y/s/e D:\mysql D:\backup\mysql

Pause



This article is from the "Square Hill" blog, please be sure to keep this source http://63638790.blog.51cto.com/513514/1672750

DOS Common commands

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.