Advertisement
Guest User

mapwebdav.vbs

a guest
Mar 13th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Const NETHOOD = &H13& ' Create under NetHood locations
  2.  
  3. Set objWSHShell = CreateObject("Wscript.Shell")
  4. Set objShell = CreateObject("Shell.Application")
  5. Set objFSO = CreateObject("Scripting.FileSystemObject")
  6. Set objFolder = objShell.Namespace(NETHOOD)
  7. Set objFolderItem = objFolder.Self
  8.  
  9. strNetHood = objFolderItem.Path
  10.  
  11. strShortcutName = "SafeWindow Documents"
  12. strShortcutPath = "\\webdav.bankvaultonline.com@SSL\Documents\"
  13.  
  14. strShareFolder = objFSO.BuildPath(strNetHood, strShortcutName)
  15. strShortcut = objFSO.BuildPath(strShareFolder, "target.lnk")
  16.  
  17. If objFSO.FolderExists(strShareFolder)=False Then
  18.     objFSO.CreateFolder(strShareFolder)
  19.  
  20.     strDesktopIni = objFSO.BuildPath(strShareFolder, "Desktop.ini")
  21.  
  22.     Set fh = objFSO.OpenTextFile(strDesktopIni, 2, True)
  23.  
  24.     fh.WriteLine "[.ShellClassInfo]"
  25.     fh.WriteLine "CLSID2={0AFACED1-E828-11D1-9187-B532F1E9575D}"
  26.     fh.WriteLine "Flags=2"
  27.     fh.Close
  28.  
  29.     strCWD = objFSO.getAbsolutePathName(".")
  30.  
  31.     Set objShortcut = objWSHShell.CreateShortcut(strShortcut)
  32.     objShortcut.TargetPath = strShortcutPath
  33.     objShortcut.WindowStyle = 1
  34.     objShortcut.IconLocation = objFSO.BuildPath(strCWD, "safewindow48.ico")
  35.     objShortcut.Save
  36.  
  37.     Set fileShortcut = objFSO.GetFile(strShortcut)
  38.     fileShortcut.attributes = 36 ' S(4) + A(32)
  39.  
  40.     Set folderShare = objFSO.GetFolder(strShareFolder)
  41.     folderShare.attributes = 1 ' R(1)
  42. End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement