Function: automatic reading. Each line of directories configured in the Dir.txt. config file, and create a shortcut to the directory under the current directory (the directory can be an accessible network disk directory, which can replace the network disk mapping, especially if the network disk mapping is too large and the number of virtual network disk drives is insufficient)
Note: statements in a For loop in a batch are parsed as a statement execution, so variable delay must be applied to ensure that the data is correct, and the closing parenthesis in the For loop is enabled for escaping
Test:
The./dir.txt content is as follows:
Pre-run Directory:
Post-run Directory:
1 @echo off2 3 Color 0a4 title automatically creates a file directory shortcut5 6 :: Setting variable delay7 setlocal enabledelayedexpansion8 9 for/F"tokens=*"%%ainch(./dirtxt Do (TenSet thepath=%%a One A for%%binch(%%a) Do ( -Set linkname=%%~Nxb.lnk - theMshta Vbscript:execute ("Set Shell=createobject (""Wscript.Shell""): Set link=shell.createshortcut (""! linkname!""): Link.targetpath=""! thepath!"": Link.Save:close"^) - - ) - ) + - EchoCreate complete! Press any key to exit +Pause>nul A at:: Description: Copy the above code into a text document, save it as a. bat file, and click Run directly to read it automatically.dir. txt in each line of the directory and create a shortcut to the directory under the current directory -::(Note: Some antivirus software may be reported poison, please allow all actions of this program and add Trust)
Batch to create shortcuts for batch processing