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

Replies to ZVBScript Upon Logon (1230 1109) rss

Title Name Language When
VB Script Main Newz vb 1 Year ago.