Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
885 B

  1. if (WScript.Arguments.length < 2)
  2. {
  3. WScript.Echo("Usage: bitsvdir.js virtual_directory local_directory");
  4. WScript.Quit(1);
  5. }
  6. VirtualDirectoryName = WScript.Arguments(0);
  7. LocalDirectoryName = WScript.Arguments(1);
  8. ServerObj = GetObject("IIS://LocalHost/W3SVC/1/ROOT");
  9. VirtualDir = ServerObj.Create("IIsWebVirtualDir", VirtualDirectoryName );
  10. MetabasePath = "/LM/W3SVC/1/Root/" + VirtualDirectoryName;
  11. VirtualDir.Path = LocalDirectoryName;
  12. VirtualDir.AppRoot = MetabasePath;
  13. VirtualDir.AppIsolated = 0;
  14. VirtualDir.AccessScript = true;
  15. VirtualDir.AccessRead = false;
  16. VirtualDir.AccessWrite = false;
  17. VirtualDir.EnableDirBrowsing = false;
  18. VirtualDir.SetInfo();
  19. VirtualDir.EnableBITSUploads();
  20. WScript.Echo( "Created virtual directory " + VirtualDirectoryName +
  21. " with a local directory of " + LocalDirectoryName );
  22. WScript.Quit( 0 );