Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. Enumerate Websites in Vista

Enumerate Websites in Vista

Scheduled Pinned Locked Moved The Weird and The Wonderful
linux
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    costas0811
    wrote on last edited by
    #1

    Just trying to get a list of websites for IIS7. First we start here:

    TempVBS2(WINSYSDIR ^ "inetsrv" ^ "appcmd.exe list site /text:site.name > " + FOLDER_TEMP ^ "site.names");

    Next interesting bit in function TempVBS2:

    if (LaunchAppAndWait(WINSYSDIR ^ "CScript.exe", SUPPORTDIR ^ "tmpbat2.vbs \"" + strCommand + "\" " + FOLDER_TEMP ^ "Magic.bat", LAAW_OPTION_HIDDEN + LAAW_OPTION_WAIT + LAAW_OPTION_WAIT_INCL_CHILD) < 0) then

    Ok so now lets run some VBScript:

    myCmd = argObj(0)
    batFile = argObj(1)
    myCmd = Replace(myCmd, "'", Chr(34))
    Set oFSO = WScript.CreateObject("Scripting.FileSystemObject")
    Set oTS = oFSO.CreateTextFile(batFile)
    oTS.WriteLine myCmd
    oTS.Close
    cmdCmd = "cmd /C " & batFile
    Set oShell = CreateObject("WScript.Shell")
    Call oShell.Run(cmdCmd, 0, True)

    Great!! At this point its 50/50 whether or not the command actually ran. Assuming it did we then:

    if (OpenFile(nFileHandle, FOLDER\_TEMP, "site.names") < 0) then
    	abort;
    endif;
    
    ret = ListCreate(STRINGLIST);
    
    while (GetLine(nFileHandle, sLine) = 0)
    	ListAddString(ret, sLine, AFTER);
    endwhile;
    
    if (CloseFile(nFileHandle) < 0) then
    	abort;
    endif;
    

    And VOILA!! We have our list of websites. Simple, elegant, mind-numbing. By the way if anyone is interested this is mostly InstallScript.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups