Implementing Code of Modifying Directory Name and Shortcut Name by Vbs

Time:2019-8-21

Copy codeThe code is as follows:
set fso=wscript.createobject(“scripting.filesystemobject”)

OldFolderName1=”263 Enterprise Messenger”
newFolderName1=”Peacemap Messenger”
OldFileName1 = “263 Enterprise Messenger.lnk”
newFileName1 = “Peacemap Messenger.lnk”
OldFileName2 = Unload 263 Enterprise Messenger. lnk
NewFileName2 = Unload Peacemap Messenger. lnk

Original path= “C: Documents and Settings All Users Start menu Program”
New path= “C: Documents and Settings All Users Start menu Program Peacemap Messenger”
Deskpath= “C: Documents and Settings All Users Desktop”

if (fso.folderexists(originalpath & “\” & OldFolderName1)) then
  Set fsoGetFolder = fso.GetFolder(originalpath & “\” & OldFolderName1)
  fsoGetFolder.Name = newFolderName1
end if

if fso.fileexists(newpath&”\”&OldFileName1 ) then
 set f=fso.getfile(newpath&”\”&OldFileName1)
 f.name=newFileName1
end if

if fso.fileexists(newpath&”\”&OldFileName2 ) then
 set f=fso.getfile(newpath&”\”&OldFileName2)
 f.name=newFileName2
end if

if fso.fileexists(deskpath&”\”&OldFileName1 ) then
 set f=fso.getfile(deskpath&”\”&OldFileName1)
 f.name=newFileName1
end if

Msgbox “Complete!”

Recommended Today

Rest command line tool demo

https://www.bilibili.com/vide… In this tutorial, we’ll show you how to use therestyCommand line tools. cd ~ export PATH=/usr/local/openresty/bin:$PATH which resty It’s usually this path. We can go through it-VOption to check its version number. resty -V If you use usPre built Linux binary packageInstall openresty, then you should install itopenresty-restyBag. dnf list installed openresty-resty Because it’s […]