From Newz, 1 Year ago, written in Visual Basic.
This paste is a reply to Re: 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. WScript.Sleep 7000
  19.  
  20. 'Special Code For Local Drive (C) (Mounted As Y:):
  21. Set oShell = WScript.CreateObject ("WScript.Shell")
  22. oShell.run "cmd.exe /c subst Y: C:\Users\User\Downloads"
  23.  
  24. Set oShell = WScript.CreateObject("Shell.Application")
  25. oShell.NameSpace("Y:\").Self.Name = "Local Drive (C)"
  26.  
  27. Set oShell = WScript.CreateObject ("WScript.Shell")
  28. oShell.run "cmd.exe /c subst /d Y:"
  29. oShell.run "cmd.exe /c subst Y: C:\"
  30.  
  31. '- - -
  32.  
  33. WScript.Sleep 7000
  34.  
  35. 'UNPIN AND PIN PROGRAMS TO TASKBAR & KILL VARIOUS TASKS:
  36.  
  37. 'Pin Programs To Taskbar
  38. Set oShell = WScript.CreateObject ("WScript.Shell")
  39. Set wsc = WScript.CreateObject("WScript.Shell")
  40. Set lnk = wsc.CreateShortcut("C:\Users\User\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\Command Prompt.lnk")
  41. lnk.targetpath = "C:\Windows\System32\cmd.exe"
  42. lnk.workingdirectory = "C:\Windows\System32"
  43. lnk.save
  44.  
  45. WScript.Sleep 7000
  46.  
  47. 'Kill Various Tasks
  48.  
  49. '>>>>>>>>>SEARCH THROUGH TASKS TO FIND MORE TO KILL
  50. Set oShell = WScript.CreateObject ("WScript.Shell")
  51. oShell.run "cmd.exe /c taskkill /f /im tvnserver.exe > nul 2>&1" 'TightVNC Tray Icon
  52. Set oShell = WScript.CreateObject ("WScript.Shell")
  53. oShell.run "cmd.exe /c taskkill /f /im pntray.exe" 'Dell vWorkspace Tray Icon
  54. Set oShell = WScript.CreateObject ("WScript.Shell")
  55. oShell.run "cmd.exe /c taskkill /f /im rthdvcpl.exe" 'Realtek Semiconductor High Definition Audio Tray Icon
  56. Set oShell = WScript.CreateObject ("WScript.Shell")
  57. oShell.run "cmd.exe /c taskkill /f /im mom.exe" 'Part Of AMD ATI Catalyst Control Center
  58. Set oShell = WScript.CreateObject ("WScript.Shell")
  59. oShell.run "cmd.exe /c taskkill /f /im ccc.exe" 'AMD ATI Catalyst Control Center Tray Icon
  60.  
  61. WScript.Sleep 7000
  62.  
  63. '>>>>>>>>>POSSIBLY LOG SUCCESS OF TASKS KILLED
  64.  
  65. 'Relaunch "Explorer.exe":
  66. Set oShell = WScript.CreateObject ("WScript.Shell")
  67. oShell.run "cmd.exe /c taskkill /f /im explorer.exe"
  68. WScript.Sleep 7000
  69.  
  70. '>>>>>>>>>COPY AND PASTE COMMAND PROMPT TO Z DRIVE as bbb.exe
  71.  
  72. oShell.run "cmd.exe /c C:/Windows/explorer"
  73. oShell.run "cmd.exe /c taskkill /f /im cmd.exe"
  74.  
  75. '>>>>>>>>>DELETE bbb.exe
  76.  
  77. '>>>>>>>>>DELETE ALL CONTENTS OF Z DRIVE
  78.  
  79. '>>>>>>>>>UPDATE CHROME (FIRST QUIT WINDOWS EXPLORER TO FREE UP RAM)
  80.  
  81. '>>>>>>>>>INSTALL CHROME EXTENSIONS
  82.  
  83.  
  84. '- - -
  85.  
  86. 'https://msdn.microsoft.com/en-us/library/5h27x7e9(v=vs.84).aspx
  87. '(If Then Single Line Syntax)
  88.  
  89. 'http://stackoverflow.com/questions/157747/vbscript-using-error-handling
  90. '(Error Handling)

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

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