Windows shortcuts use relative path

  

The mobile hard disk stores the installation-free software, and wants to set the software shortcut in the root directory, but when using the mobile hard disk on other computers, the shortcut is changed because the drive letter changes. Invalid. But can't use relative path, what should I do? The solution is as follows:

Open Notepad and edit the following content (assuming that the root directory of the USB flash drive has a [games] folder, and the shortcuts that need to be built point to the contents of it):

Start "" "Game\\steam\\Steam.exe"

Save to the root directory of the USB flash drive with the file name "Steam.bat" (Note: The save type is "All files (*.*)" "If you don't, the full name of your file is Stream.bat.txt."

Once you've built it, double-click it to run the Steam program directly like Windows shortcuts!

If you need to open multiple programs at the same time with a single shortcut, change the edit to:

start "" Tools\\Network\\FlashGet v1.71\\FlashGet.exe

start "" Tools\\Network\\Tencent\\qq\\QQ.exe

start "" File\\Material\\Beautiful MM Photo\\

start "" Tools\\Entertainment\\Winamp\\Winamp .exe file\\MP3\\MP3 list.m3u

start "" EXPLORER.EXE /e, file\\material\\beautiful MM photos\\

Save as "common software.bat", double click "Common Software .bat" can run both FlashGet and QQ programs, open the "Beautiful MM Photo" folder, play the "MP3 List.m3u" song list with Winamp, and open the "Pretty MM Photo" file with Explorer. Clip

The format of this command is:

start+half space+""+half-width space+program, file or folder path

If there is a space in the path, the whole The path must be enclosed in half-width double quotes, otherwise it will not be recognized! If you follow the file or folder will open with the default program, of course, if you want to run with parameters or use your own program to open the file, you can still add the corresponding program path and parameters in front of the file path, such as in the example In the last line of the command, EXPLORER.EXE is the specified open program. The parameter "/e," means open with the resource manager!

Here, the path of the program, file or folder uses a relative path that does not indicate the drive letter, so the system will automatically look for the current drive letter and Windows installation directory, so that the drive letter is not changed. ! ! ! Of course, Explorer.exe does not need to add a detailed path. After all, the system main files of each computer are not installed in C:\\Windows! ! ! The DOS window will automatically disappear after the program runs. If it does not disappear, please check and delete the extra blank lines in the batch file.

The Start command can not only open programs, files, but also directly call IE or the system default browser to open the URL! So we can also open all the usual URLs at the same time in this way~ Edit the following command:

start "" http://www.google.com/

start "" http://www.msn.com.cn/

Save as a .bat file. You can open the Google and MSN homepages at the same time by running this file.

In addition, because the actual use of the batch file, you can also add the "copy" file \\MP3\\*.*" D:\\" command line to the file in the folder Copy all to your hard drive! ! !

The above is the setting for Windows XP. If it is not correct, I still want to correct it~~~

Copyright © Windows knowledge All Rights Reserved