Batch to create shortcuts for batch processing

Source: Internet
Author: User

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

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.