Home  >  Article  >  Computer Tutorials  >  How to skillfully create folders in batches using the command prompt

How to skillfully create folders in batches using the command prompt

王林
王林forward
2024-01-11 17:48:301661browse

How to skillfully create folders in batches using the command prompt

How to create folders in batches using the command prompt

These are just basic applications of command prompt tools, but in special cases, it can improve work efficiency, such as batch creation of folders.

Create Deep Folder

In Windows Explorer, to create a multi-level folder "a\b\c\d", four folder creation operations are required. However, with Command Prompt, you can accomplish this task by just entering a single command.

First, click "Start - All Programs - Accessories - Command Prompt", or press the shortcut key "Win R", then enter "cmd" and run to open the "Command Prompt" window. Next, type the following command.

md f:\a\b\c\d

After pressing the Enter key, a subfolder named "a" will be created under the F drive. Then, a subfolder named "b" will be created under the "a" folder. By analogy, multi-level folders can be created in sequence. Remember to add a half-width space bar after using the md command.

Create multiple folders

If you need to create 4 folders named "a", "b", "c", and "d" respectively in a certain directory, you can quickly achieve it through the following command: Open in the target folder Command line window and enter the command "mkdir a b c d". In this way, these four folders can be created at the same time.

You can also execute this command by entering the directory, such as "md f:\a f:\b", which will create folders named "a" and "b" respectively under the F drive.

For the convenience of explanation, the examples in the text are all in English. You can enter Chinese as needed, so that you can create a folder with a Chinese name.

Create command prompt switch wifi

@echo off

echo.&echo.

echo Wifi Startup Assistant

echo.&echo.

echo [ Y=on ] [ N=off ]

echo.&echo.

set/p a=Please enter the command:

if %a%==Y pause>nul&goto b

if %a%==N pause>NUL&GOTO a

:b

netsh wlan set hostednetwork mode=allow ssid=wifiname key=wifipassword

netsh wlan start hostednetwork

:a

netsh wlan stop hostednetwork

netsh wlan set hostednetwork mode=disallow

Change the ssid and password yourself.

How to create a computer user using CMD

Enter the following command at the MS-DOS prompt: "net user john 123 /add" and press Enter. You can create a new user named "John" with the password "123".

The Add parameter indicates a new user.

Create a user with limited login time

Use the following methods to control computer usage time. For example, you need to create a user account for John with a password of "123" and login permissions from 8 a.m. to 10 p.m. from Monday to Friday and from 7 p.m. to 9 p.m. on weekends.

1. For the 12-hour clock, type the following command: "net user john 123 /add /times:monday-friday,8AM-10PM;saturday-sunday,7PM-9PM" and press Enter to confirm.

2. For 24-hour format, you can type the following command: "net user john 123 /add /times:M-F,8:00-22:00;Sa-Su,19:00-21:00" and press Enter to confirm. Can.

It is worth noting: The increase value of Time is limited to 1 hour. For Day values, you can use the full name or abbreviation (i.e. M, T, W, Th, F, Sa, Su). Either 12-hour or 24-hour time notation can be used. For 12-hour notation, use AM, PM or A.M., P.M. An All value means the user can always log in; an empty value (blank) means the user can never log in. Use commas to separate days and times, and semicolons to separate days and time units (for example, M, 4AM-5PM; T, 1PM-3PM). Do not use spaces when specifying time.

In addition, the Passwordchg:{yesno} parameter can be used to specify whether users can change their passwords. The default setting is Yes.

If used without parameters, Net User will display the list of users on the computer. For example, type the following command: "net user" and press Enter to display all users of the system.

If you type: "net user john" and press Enter, user John's information will be displayed.

If you type the command: "net user john 123456 /add" and press Enter to confirm, the password of user John (John is an existing user) will be forcibly changed to 123456.

If you type the command: "net user john /delete" and press Enter to confirm, user John can be deleted

The above is the detailed content of How to skillfully create folders in batches using the command prompt. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:docexcel.net. If there is any infringement, please contact admin@php.cn delete