Advertisement
Deniseo

Создание "запароленной" папки

Mar 1st, 2016
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Dim password, user, test, tmp, tmp2, path, path2, name
  2.  
  3. password = "151200" '«<------— тут пишите свой пароль вместо "151200".
  4. test = "1"
  5. tmp = "1"
  6. tmp2 = MsgBox ( "Хотите создать новое хранилище?" , "4", "Файловый банк v1.0")
  7. If tmp2 = "6" then
  8. Call create1
  9. Else if tmp2 = "7" then
  10. Call tooopen
  11. End if
  12. '----------------------------------------
  13. Sub create1
  14. path = inputbox ("Введите название нового хранилища:")
  15. set fso = createobject ("scripting.filesystemobject")
  16. fso.createfolder "c:\Windows\"&path
  17. End Sub
  18. Sub toopen()
  19. name = inputbox ("Введите название хранилища:")
  20. Call open1
  21. End Sub
  22. '----------------------------------------
  23. Sub tooopen
  24. Do
  25. user = inputbox ("Введите код доступа:")
  26. if user = password then
  27. call toopen
  28. End if
  29. Call close
  30. Loop
  31. End Sub
  32. Sub open1()
  33. set objShellApp = CreateObject("Shell.Application")
  34. objShellApp.open("c:\Windows\" &name)
  35. Wscript.Quit
  36. End Sub
  37. Sub close()
  38. MsgBox "Вы ввели неверный пароль! Компютер будет перезагружен!"
  39. Dim strComputer
  40. Dim strNamespace
  41. Dim strClass
  42. Dim objClass
  43. Dim colInstances
  44. Dim objInstance
  45. strComputer = "."
  46. strNamespace = "Root\CIMV2"
  47. strClass = "Win32_OperatingSystem"
  48. Set objClass = GetObject("WinMgmts:{(Shutdown,RemoteShutdown)}!\\" &_
  49. strComputer & "\" & strNamespace & ":" & strClass)
  50. Set colInstances = objClass.Instances_
  51. For Each objInstance In colInstances
  52. objInstance.Reboot()
  53. Next
  54. Wscript.Quit
  55. End Sub
  56. End if
  57. '-------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement