博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
usb驱动程序_如何为USB驱动器上的程序创建快捷方式
阅读量:2506 次
发布时间:2019-05-11

本文共 6174 字,大约阅读时间需要 20 分钟。

usb驱动程序

usb驱动程序

00_shortcuts_to_programs_on_usb_drive

If you work on multiple computers, you probably use a USB drive to take your favorite portable software with you. Portable application suites like , , or , each have a main menu providing access to the programs installed into the suite.

如果您在多台计算机上工作,则可能会使用USB驱动器随身携带自己喜欢的便携式软件。 诸如 , 或类的便携式应用程序套件,每个都有一个主菜单,可以访问安装在套件中的程序。

However, there may be reasons why you need to create shortcuts to programs on your USB drive. You may be using a program that does not integrate into the suite’s main menu. Or, you may not be using an official portable application suite at all, and just placing portable software in a folder on your USB drive. Maybe you prefer using shortcuts on the root of the USB drive, like a portable desktop.

但是,可能由于某些原因,您需要为USB驱动器上的程序创建快捷方式。 您可能正在使用未集成到套件主菜单中的程序。 或者,您可能根本没有使用官方的便携式应用程序套件,而只是将便携式软件放在USB驱动器的文件夹中。 也许您更喜欢在USB驱动器根目录上使用快捷方式,例如便携式台式机。

Whatever your reason, you can’t just create a shortcut to an application on the USB drive and place it in the root of the drive. The shortcut will always refer to the full path of the application, including the drive letter. Different computers assign different drive letters to USB flash drives, so you would have to change the drive letter for your shortcuts when it changes. You can . However, if you would rather not do that, there is a way to create shortcuts to programs on a USB drive using relative paths.

无论出于何种原因,您都不能仅在USB驱动器上创建应用程序的快捷方式并将其放置在驱动器的根目录中。 快捷方式将始终引用应用程序的完整路径,包括驱动器号。 不同的计算机为USB闪存驱动器分配了不同的驱动器号,因此,更改快捷方式时,您必须更改其驱动器号。 您可以 。 但是,如果您不想这样做,则可以使用相对路径在USB驱动器上创建程序的快捷方式。

Because Windows does not support relative paths in shortcuts, we will show you how to create a “shortcut” on the root of a USB drive by creating a batch (.bat) file and converting it to an executable (.exe) file.

由于Windows不支持快捷方式中的相对路径,因此我们将向您展示如何通过创建批处理(.bat)文件并将其转换为可执行文件(.exe)在USB驱动器的根目录上创建“快捷方式”。

To create the batch file, open a text editor, such as Notepad, and enter the full path, including the name of the executable file, to the program for which you want to create a shortcut. However, make this a relative path by leaving out the drive letter and the first backslash. Also, surround the path with quotes. We will use the free icon extraction program, BeCyIconGrabber, as an example. The image below shows an example of the relative full path to the program on our USB flash drive.

要创建批处理文件,请打开文本编辑器(如记事本),然后输入要为其创建快捷方式的程序的完整路径,包括可执行文件的名称。 但是,通过省略驱动器号和第一个反斜杠,使之成为相对路径。 另外,请在路径两边加上引号。 我们将以免费的图标提取程序BeCyIconGrabber为例。 下图显示了USB闪存驱动器上程序的相对完整路径的示例。

01_entering_path_to_program

In the text editor, save the file as a .bat file in a location of your choosing. We saved our file to a special directory on our USB flash drive.

在文本编辑器中,将文件另存为.bat文件在您选择的位置。 我们将文件保存到USB闪存驱动器上的特殊目录中。

NOTE: It doesn’t matter too much where you save the batch file. The location of the final executable file is what matters.

注意:在哪里保存批处理文件都没关系。 最终可执行文件的位置很重要。

03_saving_batch_file

You can put an icon on your shortcut by extracting the icon from the program’s .exe file and adding it to the executable file you will create for your shortcut. To extract the icon from the program file, see our article about . You should end up with an icon (.ico) file as shown below.

通过从程序的.exe文件中提取图标并将其添加到将为快捷方式创建的可执行文件中,可以在快捷方式上放置图标。 要从程序文件中提取图标,请参阅有关 。 您应该最终得到一个图标(.ico)文件,如下所示。

04_extracted_icon_file

To convert your batch file into an executable file, download the free program . The program does not need to be installed. Simply extract the files from the .zip file and double-click on the .exe file to run the program.

要将您的批处理文件转换为可执行文件,请下载免费程序 。 该程序不需要安装。 只需从.zip文件中提取文件,然后双击.exe文件即可运行该程序。

05_running_bat_to_exe_converter

On the Bat To Exe Converter program window, click the browse (…) button to the right of the Batch file edit box.

在Bat To Exe Converter程序窗口中,单击“批处理文件”编辑框右侧的浏览(...)按钮。

06_clicking_browse_for_batch_file

On the Select the batch file dialog box, navigate to the folder in which you saved your .bat file, select the file, and click Open.

在“选择批处理文件”对话框上,导航到保存.bat文件的文件夹,选择文件,然后单击“打开”。

07_selecting_batch_file

Now, we need to specify the name and location of the resulting .exe file. By default, the same location as the batch file is entered as the save location. However, we didn’t save our batch file on the root of our USB flash drive, but we want to save the executable shortcut file on the root. To change the location, click the browse (…) button to the right of the Save as edit box.

现在,我们需要指定生成的.exe文件的名称和位置。 默认情况下,输入与批处理文件相同的位置作为保存位置。 但是,我们没有将批处理文件保存在USB闪存驱动器的根目录下,而是希望将可执行的快捷方式文件保存在根目录下。 要更改位置,请单击“另存为”编辑框右侧的浏览(...)按钮。

NOTE: You can also type the paths and filenames in the edit boxes directly, instead of using the browse buttons.

注意:您也可以直接在编辑框中键入路径和文件名,而不使用浏览按钮。

08_clicking_browse_for_save_as

On the Save as dialog box, navigate to the root of the USB flash drive, and enter a filename for the shortcut in the File name edit box. Click Save.

在“另存为”对话框中,导航到USB闪存驱动器的根目录,然后在“文件名”编辑框中输入快捷方式的文件名。 单击保存。

09_selecting_root_of_usb_drive

To run the batch file “invisibly,” with no console window opening in the background, select the Invisible application option in the Visibility box.

要“不可见地”运行批处理文件,而在后台没有打开控制台窗口,请在“可见性”框中选择“不可见的应用程序”选项。

10_selecting_invisible_application

To add the icon you extracted to the .exe shortcut file, click the Versioninformations tab and then click the browse (…) button to the right of the Icon file edit box.

要将提取的图标添加到.exe快捷方式文件中,请单击“版本信息”选项卡,然后单击“图标”文件编辑框右侧的浏览(...)按钮。

11_clicking_browse_for_icon_file

On the Select the icon file dialog box, navigate to the folder where you saved the extracted .ico file, select it, and click Open.

在“选择图标文件”对话框上,导航到保存提取的.ico文件的文件夹,将其选中,然后单击“打开”。

12_selecting_icon_file

The path to the icon file is entered into the Icon file edit box. Click Compile to create your .exe shortcut file.

图标文件的路径输入到“图标文件”编辑框中。 单击“编译”以创建您的.exe快捷方式文件。

13_clicking_compile

To close Bat To Exe Converter, click the X button in the upper, right corner of the dialog box.

要关闭Bat To Exe Converter,请单击对话框右上角的X按钮。

14_closing_bat_to_exe_converter

The new .exe shortcut file is available on the root of your USB flash drive. Double-click it to run the program.

新的.exe快捷方式文件位于USB闪存驱动器的根目录中。 双击运行该程序。

15_executable_file_created

Here is the BeCyIconGrabber program opened from our converted batch file.

这是从转换后的批处理文件中打开的BeCyIconGrabber程序。

16_becyicongrabber_open

Now you can easily create shortcuts to programs on your USB flash drive that will work no matter what drive letter is assigned to your drive on any Windows computer.

现在,您可以轻松地为USB闪存驱动器上的程序创建快捷方式,无论在任何Windows计算机上为驱动器分配了什么驱动器号,该快捷方式都将起作用。

翻译自:

usb驱动程序

转载地址:http://vpkwd.baihongyu.com/

你可能感兴趣的文章
windows 不能在 本地计算机 启动 Apache
查看>>
iOS开发报duplicate symbols for architecture x86_64错误的问题
查看>>
Chap-6 6.4.2 堆和栈
查看>>
java初学知识点
查看>>
【Spring学习笔记-MVC-15】Spring MVC之异常处理
查看>>
【Java学习笔记之九】java二维数组及其多维数组的内存应用拓展延伸
查看>>
C# MySql 连接
查看>>
网络抓包分析方法大全
查看>>
sql 数据类型
查看>>
android 截图
查看>>
WebServicer接口类生成方法。
查看>>
POJ 1740
查看>>
【翻译】火影忍者鸣人 疾风传 终级风暴2 制作介绍
查看>>
http和webservice
查看>>
hdu1879------------prim算法模板
查看>>
jdbc之二:DAO模式
查看>>
MySQL性能优化方法一:缓存参数优化
查看>>
如何捕获 System.loadLibrary 产生的异常?(转)
查看>>
Jmeter4.0安装
查看>>
Angular2 - 概述
查看>>