From Newz, 1 Year ago, written in Visual Basic.
This paste is a reply to Re: VBScript Upon Logon (1230 1109) from Newz - view diff
Embed
  1. 'MAP FOLDERS TO SIDEBAR AS SUBSTITUTED DIRECTORIES:
  2. Set oShell = WScript.CreateObject ("WScript.Shell")
  3. oShell.run "cmd.exe /c subst T: ""C:\Users\User\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch"""
  4. oShell.run "cmd.exe /c subst U: ""C:\Users\User\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\Taskbar"""
  5. oShell.run "cmd.exe /c subst V: C:\Users\User"
  6. oShell.run "cmd.exe /c subst W: C:\Users\User\Documents"
  7. oShell.run "cmd.exe /c subst X: C:\Users\User\Downloads"
  8. oShell.run "cmd.exe /c subst Y: C:\"
  9.  
  10. 'Rename Drive Letters:
  11. Set oShell = WScript.CreateObject("Shell.Application")
  12. oShell.NameSpace("T:\").Self.Name = "System Pinned"
  13. oShell.NameSpace("U:\").Self.Name = "User Pinned"
  14. oShell.NameSpace("V:\").Self.Name = "User (Home)"
  15. oShell.NameSpace("W:\").Self.Name = "Documents"
  16. oShell.NameSpace("X:\").Self.Name = "Downloads"
  17.  
  18. 'Special Code For Local Drive (C) (Mounted As Y:):
  19. Set oShell = WScript.CreateObject ("WScript.Shell")
  20. oShell.run "cmd.exe /c subst Y: C:\Users\User\Downloads"
  21.  
  22. Set oShell = WScript.CreateObject("Shell.Application")
  23. oShell.NameSpace("Y:\").Self.Name = "Local Drive (C)"
  24.  
  25. Set oShell = WScript.CreateObject ("WScript.Shell")
  26. oShell.run "cmd.exe /c subst /d Y:"
  27. oShell.run "cmd.exe /c subst Y: C:\"
  28.  
  29. '- - -
  30.  
  31. 'UNPIN AND PIN PROGRAMS TO TASKBAR & KILL VARIOUS TASKS:
  32.  
  33. 'Pin Programs To Taskbar
  34. Set wsc = WScript.CreateObject("WScript.Shell")
  35. Set lnk = wsc.CreateShortcut("C:\Users\User\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\Taskbar\Command Prompt.lnk")
  36. lnk.targetpath = "C:\Windows\System32\cmd.exe"
  37. lnk.workingdirectory = "C:\Windows\System32"
  38. lnk.save
  39.  
  40. 'Kill Various Tasks
  41.  
  42. '>>>>>>>>>SEARCH THROUGH TASKS TO FIND MORE TO KILL
  43.  
  44. oShell.run "cmd.exe /c taskkill /f /im tvnserver.exe" 'TightVNC Tray Icon
  45. oShell.run "cmd.exe /c taskkill /f /im pntray.exe" 'Dell vWorkspace Tray Icon?
  46. oShell.run "cmd.exe /c taskkill /f /im rthdvcpl.exe" 'Realtek Semiconductor High Definition Audio Tray Icon
  47. oShell.run "cmd.exe /c taskkill /f /im mom.exe" 'Part Of AMD ATI Catalyst Control Center
  48. oShell.run "cmd.exe /c taskkill /f /im ccc.exe" 'AMD ATI Catalyst Control Center Tray Icon
  49.  
  50. '>>>>>>>>>POSSIBLY LOG SUCCESS OF TASKS KILLED
  51.  
  52. 'Relaunch "Explorer.exe":
  53. Set oShell = WScript.CreateObject ("WScript.Shell")
  54. oShell.run "cmd.exe /c taskkill /f /im explorer.exe"
  55. WScript.Sleep 2000
  56.  
  57. '>>>>>>>>>COPY AND PASTE COMMAND PROMPT TO Z DRIVE as bbb.exe
  58.  
  59. oShell.run "cmd.exe /c C:/Windows/explorer"
  60. oShell.run "cmd.exe /c taskkill /f /im cmd.exe"
  61.  
  62. '>>>>>>>>>DELETE bbb.exe
  63.  
  64. '>>>>>>>>>DELETE ALL CONTENTS OF Z DRIVE
  65.  
  66. '>>>>>>>>>UPDATE CHROME (FIRST QUIT WINDOWS EXPLORER TO FREE UP RAM)
  67.  
  68. '>>>>>>>>>INSTALL CHROME EXTENSIONS
  69.  
  70.  
  71. '- - -
  72.  
  73. 'https://msdn.microsoft.com/en-us/library/5h27x7e9(v=vs.84).aspx
  74. '(If Then Single Line Syntax)
  75.  
  76. 'http://stackoverflow.com/questions/157747/vbscript-using-error-handling
  77. '(Error Handling)

Replies to Re: Re: VBScript Upon Logon (1230 1109) rss

Title Name Language When
Re: Re: Re: VBScript Upon Logon (1230 1109) Newz vb 1 Year ago.