Friday, May 23, 2014

User Profile Folder and URL rename Using VB scripts

On Error Resume Next  

Dim FSO
Dim FSOFol
Set oShell = CreateObject( "WScript.Shell" )
USERPROFILE=oShell.ExpandEnvironmentStrings("%USERPROFILE%")


Set FSOFol = CreateObject("Scripting.FileSystemObject")
strFolder = USERPROFILE & "\Favorites\Microsoft Websites"

  strFolderRename = USERPROFILE & "\Favorites\Websites"
   If FSOFol.FolderExists(strFolder) Then
        FSOFol.MoveFolder strFolder, strFolderRename
   End If

  Set FSO = CreateObject("Scripting.FileSystemObject")
  strFile = USERPROFILE & "\Favorites\Websites\Microsoft Store.url"
  strRename = USERPROFILE & "\Favorites\Websites\test.url"
   If FSO.FileExists(strFile) Then
        FSO.MoveFile strFile, strRename
   End If




No comments:

Post a Comment