更改多个快捷方式的驱动器号(Change the drive

编程入门 行业动态 更新时间:2024-10-28 16:27:33
更改多个快捷方式的驱动器号(Change the drive-letter for multiple shortcuts)

我有点问题。 我为我的计算机准备了三个备份盘,还有一些病态的快捷方式。

我的目标是从以下位置更改多个窗口快捷方式(.ink)的“目标”和“打开”值:

“A:\文件夹\ File.mpg”

“d:\文件夹\ File.mpg”

大约2k文件。

关于如何在windows-shortcuts(.ink)中查找(和更改)“target”和“open in”值,我只是空白。 要清楚,它只是分区字母“A”:\在这种情况下,我希望更改(到“D”),字符串中没有其他内容。 (适用于多个项目)

想的是:

dim letterOne = combobox1.text dim letterTwo = combobox2.text for each file shortcut.TargetPath("letterOne ", "*.ink")

改成

shortcut.TargetPath("letterTwo", "*.ink")

I got a little problem. I got three backupdiscs for my computer and a sick ammount of windows-shortcuts.

My goal is to change the "target" and "open in" value for multiple windows-shortcuts (.ink) from:

"A:\Folder\File.mpg"

to

"D:\Folder\File.mpg"

for around 2k files.

I'm just blank on how to find (and change) the "target" and "open in" value within the windows-shortcuts (.ink). To be clear, it's only the partition letter, "A":\ in this case, I wish to change (to "D"), nothing else in the string. (for multiple items)

was thinking something like:

dim letterOne = combobox1.text dim letterTwo = combobox2.text for each file shortcut.TargetPath("letterOne ", "*.ink")

Change to

shortcut.TargetPath("letterTwo", "*.ink")

最满意答案

如果我正确地阅读了这个问题,你可以使用Replace string函数:

MyString.Replace("A:","D:")

如果您需要为大量文件执行此操作,请构建文件名的集合,然后使用For Each循环。

If I am reading the question correctly, you can just use the Replace string function:

MyString.Replace("A:","D:")

If you need to do it for a lot of files, build a collection of the filenames and then use a For Each loop.

更多推荐

ink,windows-shortcuts,change,电脑培训,计算机培训,IT培训"/> <meta name="

本文发布于:2023-07-23 02:40:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1226598.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:多个   驱动器   快捷方式   drive   Change

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!