code_junkie

execute caspol from within vbscript

Nov 12th, 2011
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. set sh = CreateObject("Wscript.Shell")
  2. Set fso = CreateObject("Scripting.FileSystemObject")
  3.  
  4. dim command
  5. dim location
  6. dim retVal
  7.  
  8. location = fso.GetFile(Wscript.ScriptFullName).ParentFolder
  9.  
  10. '%windir%microsoft.netframeworkv2.0.50727caspol.exe -pp off -m -addgroup 1 –url file://COMPUTER/SHARE/* FullTrust -name sbw2
  11. command = fso.GetSpecialFolder(0) & "microsoft.netframeworkv2.0.50727caspol.exe -pp off -m -ag 1 –url file://"
  12. for each s in Split(location, "")
  13. if Len(s) > 0 then
  14. command = command & s & "/"
  15. end if
  16. next
  17. command = command & "* FullTrust -name sbw2"
  18.  
  19. 'DEBUG
  20. 'command = fso.GetSpecialFolder(0) & "microsoft.netframeworkv2.0.50727caspol.exe -m -ag 1 –url file://mjlaptop/sbw2/* FullTrust"
  21. Wscript.StdOut.WriteLine VbClrf
  22. Wscript.StdOut.WriteLine command
  23. Wscript.StdOut.WriteLine VbClrf
  24.  
  25. Set output = sh.Exec(command)
  26.  
  27. dim text
  28. while Not output.StdOut.AtEndOfStream
  29. text = text & output.StdOut.Read(1)
  30. Wend
  31. Wscript.StdOut.WriteLine text
  32.  
  33. "C:WINDOWSmicrosoft.netframeworkv2.0.50727caspol.exe -pp off -m -ag 1 -url "file://mjlaptop/sbw2/*" FullTrust -name sbw2
  34.  
  35. \mjlaptopsbw2setpolicy.vbs(32, 1) WshShell.Exec: Das System kann die angegebene Datei nicht finden.
  36.  
  37. "C:WINDOWSmicrosoft.netframeworkv2.0.50727caspol.exe" -pp off -m -ag 1 -url "file://mjlaptop/sbw2/*" FullTrust -name sbw2
  38.  
  39. Microsoft (R) .NET Framework CasPol 2.0.50727.42
  40. Copyright (c) Microsoft Corporation. Alle Rechte vorbehalten.
  41.  
  42. Fehler: Unbekannte Mitgliedschaftsbedingung - -url..
Add Comment
Please, Sign In to add comment