Tuesday 15 July 2014

vbscript - How to output all sub-folder to a drop down list in a HTA? -


I have a code like I have: all for the drop-down list in HT: K: all in the job I want to produce sub-folders. Because all subfolders in Kashmir: \ work change all the time. So every time I click on the drop down list, it needs to have the latest content in it, is it possible to do it based on my code? And when I select a new customer, I need a popup window that allows me to enter the name and create a new folder.

In my code I have 1 drop down list. I need 7 drop down lists in this html, with all the same concept that can not be created if new folder is created. Such file structure: K: \ Customer \ Design \ Detail \ ORDER ...... If I select a folder from the upper level in the drop down list, then each level drop-down list sub-folder produces The remaining drop-down list will be changed to sub-folders in that parent folder. Can anyone help me?


  & lt; HEAD & gt; & Lt; TITLE & gt; The structure of the drive program & lt; / TITLE & gt; & Lt; HTA: Application ID = "AIDS" APPLICATIONNAME = "K drive program structure" border = "dialog" heading = "yes" scroll = "no" SHOWINTASKBAR = "yes" SINGLEINSTANCE = "yes" SYSMENU = "yes" WINDOWSTATE = "max. "& Gt; & Lt; / HEAD> & Lt; Body & gt; & Lt; SCRIPT LANGUAGE = "VBScript" & gt; Sub Window_OnLoad Window.Site.Focus End Sub sub btn01_OnClick Dim strProduct oElements = Window.Site.SelectedIndex strProduct = Window.Site.Options (oElements) .text Choose episode strProduct Case "AMCAN HONSEL" MsgBox, 64 "You selected AMCAN HONSEL", "Select" Episode "Chrysler Etobicoke" MsgBox "You selected the Chrysler Etobicoke", 64, "Selection" Episode "Chrysler KOKOMO" MsgBox, 64 "You Chrysler KOKOMO" "Selection" Episode "GM Powertrain" MsgBox "You selected GM Powertrain" "Selection" Episode "Mercedes-Benz" MsgBox "You selected Mercedes-Benz", 64, "Selection" Episode "NEMAK" MsgBox "You selected NEMAK", 64, "Selection" Episode "New Customer" MsgBox Selected new customer ", 64," Selection "End Select ending sub sub btn02_OnClick Window.Close End Sub & lt; / SCRIPT & gt; & Lt; H2 & gt; Drive structure of & lt; / H2> & Lt; P & gt; Please select or create: & lt; SELECT NAME = "Site" & gt; & Lt; OPTION & gt; AMCAN HONSEL & lt; / OPTION & gt; & Lt; OPTION & gt; Chrysler etikocike & lt; / OPTION & gt; & Lt; OPTION & gt; Chrysler Kokomo & lt; / OPTION & gt; & Lt; OPTION & gt; GM Powertrain & lt; / OPTION & gt; & Lt; OPTION & gt; Mercedes-Benz & lt; / Options & gt; & Lt; Options & gt; NEMAK & lt; / Options & gt; & Lt; OPTION & gt; New customer & lt; / OPTION & gt; & Lt; / Select & gt; & Lt; P & gt; & Lt; BR & gt; & Lt; BR & gt; & Lt; Input type = "button" name = "btn 01" VALUE = "SUBMIT" & gt; & Lt; Input type = "button" name = "btn 02" VALUE = "off" & gt; & Lt; BR & gt; & Lt; BR & gt; & Lt; / Body & gt;    

You can fill a dropdown list in the HTML like this:

  The sub-update list for each update list. Option opt.RemoveNode Next set fso = CreateObject ("Scripting.FileSystemObject") fso.GetFolder ("K: \ work") for each F. Set subFolders opt = document .createElement ("OPTION") opt.Text = f.Name opt.Value = f.Path list.Add (opt) Next End Sub   

dropdown list The HTML tag should look like this:

  & lt; Id = "list" name = "list" onMouseOver = "UpdateList" & gt; & Lt; / Select & gt;   

However, by creating a directory browser with dropdown lists, I do not have to hit this kind of hot idea. Why can not you use the method for any particular reason?

  Set OS = Create Object ("shell.nap") basedir = os.Namespace ("K: \ work"). Set Self.Path fldr = os.BrowseForFolder (0, "Choose Folder:", & amp; H10 & amp ;, basedir)   

You are trying to solve real What's the problem?

No comments:

Post a Comment