Advertisement
Guest User

Untitled

a guest
Jun 19th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.33 KB | None | 0 0
  1. '* Имя: Interact.vbs
  2. '* Язык: VBScript
  3. '* Описание: пример лаболаторной работы
  4. '******************************************************************
  5. Dim s
  6. ' Выводим строку на экран
  7. do
  8. WScript.StdOut.WriteLine "МЕНЮ:"
  9. WScript.StdOut.WriteLine "----------------------------"
  10. WScript.StdOut.WriteLine "1. Информация о авторе"
  11. WScript.StdOut.WriteLine "2. Перенос файлов заданного расширения с указанного места в папку «backup», на заданном диске."
  12. WScript.StdOut.WriteLine "3. Сохранение в блокноте параметра реестра: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\BuildLab"
  13. WScript.StdOut.WriteLine "4. Выход"
  14. WScript.StdOut.Write "Выберите пункт меню:"
  15. ' Считываем строку
  16. s = WScript.StdIn.ReadLine
  17. ' Создаем объект WshShell
  18. Set WshShell = WScript.CreateObject("WScript.Shell")
  19. if (s="1") Then
  20. WScript.StdOut.WriteLine "Левкович Владимир Михайлович ТМ-51"
  21. elseif(s="2") Then
  22. WScript.StdOut.WriteLine "Введите расширение файла"
  23. fileextension = WScript.StdIn.ReadLine
  24. WScript.StdOut.WriteLine "Где находятся файлы"
  25. filespath = WScript.StdIn.ReadLine
  26. WScript.StdOut.WriteLine "Введите букву диска"
  27. driveletter = WScript.StdIn.ReadLine
  28. Dim WshShelli
  29. Set WshShell = WScript.CreateObject("WScript.Shell")
  30. 'WScript.StdOut.WriteLine "cmd /K Copy " & filespath & "\*." & fileextension & " " & driveletter & ":\backup"
  31. WshShell.run "cmd /C Copy " & filespath & "\*." & fileextension & " " & driveletter & ":\backup"
  32. 'Code=WshShell.Run("%COMSPEC% /c backuper.bat >"+fileextension +filespath +driveletter ,0,true)
  33. elseif(s="3") Then
  34. WScript.StdOut.Write "Введите имя ярлыка:"
  35. f = WScript.StdIn.ReadLine
  36. ' Создаем ярлык на сетевой ресурс
  37. Set oUrlLink = WshShell.CreateShortcut(f+".URL")
  38. WScript.StdOut.Write "Введите имя ресурса:"
  39. f = WScript.StdIn.ReadLine
  40. ' Устанавливаем URL
  41. oUrlLink.TargetPath = f
  42. ' Сохраняем ярлык
  43. oUrlLink.Save
  44. End if
  45. loop until (s="4")
  46. '************* Конец *********************************************
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement