Jump to content

rgaspar

Member
  • Posts

    3
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    Portugal

Posts posted by rgaspar

  1. Ok, nevermind

    I found this solutions.

    All shortcut's and path's have the same letter drive.

    Thanks

    Hello,

    This script in HTA not show radio button :(

    For each objTarget in colTargetList

    ReDim Preserve arrButtons(1,UBound(arrButtons,2)+1)

    arrButtons(0,UBound(arrButtons,2)) = objShortcut.Description

    arrButtons(1,UBound(arrButtons,2)) = "<Input type=radio name=radioList id='" & objTarget.Drive & objTarget.Path & objTarget.fileName &_

    "' onClick=showRadioInfo>" & objShortcut.Description & "</BUTTON><BR>"

    Next

    I create one simply script in vbs, name is testpath.vbs and resume object objtarget.drive, objtarget.path and objtarget.filename not run correctly.

    Cant i help me for this issue?

    testpath.vbs

    strcomputer="."

    dim objshell, objfso, objwmiservice, strDrive

    set objshell = createobject("wscript.shell")

    set objfso = createobject("scripting.filesystemobject")

    set objwmiservice = getobject ("winmgmts:\\" & strcomputer & "\root\cimv2")

    dim colsubfolders, objfolder, filename

    set colsubfolders = objwmiservice.execquery _

    ("Associators of {win32_directory.name='z:\winpe'} where assocclass = win32_subdirectory resultrole = partcomponent")

    for each objfolder in colsubfolders

    filename = objfolder.filename

    wscript.echo objfolder.name

    next

    for each objfolder in colsubfolders

    filename = objfolder.filename

    wscript.echo filename

    next

    dim colfilelist, objfile, objshorcut, coltargetlist, objtarget

    set colfilelist = objwmiservice.execquery _

    ("Associators of {win32_directory.name='z:\winpe\" & filename & "'} where resultclass = CIM_DataFile")

    for each objfile in colfilelist

    if objfile.extension = "lnk" then

    set objshortcut = objshell.createshortcut(objfile.name)

    set coltargetlist = objwmiservice.execquery _

    ("select * from CIM_DataFile where name = '" & replace(objshortcut.targetpath,"\","\\") & "'")

    wscript.echo objfile.name

    wscript.echo objshortcut.description

    for each objtarget in coltargetlist

    wscript.echo objtarget.drive

    wscript.echo objtarget.path

    wscript.echo objtarget.filename

    next

    end if

    next

    My hta not show radio buttons :(

    Thanks for help me....

  2. Hello,

    This script in HTA not show radio button :(

    For each objTarget in colTargetList
    ReDim Preserve arrButtons(1,UBound(arrButtons,2)+1)
    arrButtons(0,UBound(arrButtons,2)) = objShortcut.Description
    arrButtons(1,UBound(arrButtons,2)) = "<Input type=radio name=radioList id='" & objTarget.Drive & objTarget.Path & objTarget.fileName &_
    "' onClick=showRadioInfo>" & objShortcut.Description & "</BUTTON><BR>"
    Next

    I create one simply script in vbs, name is testpath.vbs and resume object objtarget.drive, objtarget.path and objtarget.filename not run correctly.
    Cant i help me for this issue?

    testpath.vbs

    strcomputer="."
    dim objshell, objfso, objwmiservice, strDrive

    set objshell = createobject("wscript.shell")
    set objfso = createobject("scripting.filesystemobject")
    set objwmiservice = getobject ("winmgmts:\\" & strcomputer & "\root\cimv2")

    dim colsubfolders, objfolder, filename

    set colsubfolders = objwmiservice.execquery _
    ("Associators of {win32_directory.name='z:\winpe'} where assocclass = win32_subdirectory resultrole = partcomponent")


    for each objfolder in colsubfolders

    filename = objfolder.filename
    wscript.echo objfolder.name
    next

    for each objfolder in colsubfolders

    filename = objfolder.filename
    wscript.echo filename
    next

    dim colfilelist, objfile, objshorcut, coltargetlist, objtarget

    set colfilelist = objwmiservice.execquery _
    ("Associators of {win32_directory.name='z:\winpe\" & filename & "'} where resultclass = CIM_DataFile")

    for each objfile in colfilelist

    if objfile.extension = "lnk" then
    set objshortcut = objshell.createshortcut(objfile.name)
    set coltargetlist = objwmiservice.execquery _
    ("select * from CIM_DataFile where name = '" & replace(objshortcut.targetpath,"\","\\") & "'")

    wscript.echo objfile.name
    wscript.echo objshortcut.description

    for each objtarget in coltargetlist

    wscript.echo objtarget.drive
    wscript.echo objtarget.path
    wscript.echo objtarget.filename

    next

    end if
    next

    My hta not show radio buttons :(

    Thanks for help me....

  3. Hello,

    I need help, please.

    I run this script wizard.hta but radio button and description file htm not display.

    Here's my code.

    '****************************************************************************
    '* enumImages
    '* find images and create radio buttons
    '****************************************************************************
    'this sub is a little messy because of limitations of win32_shortcutfile and need to go between fso and wmi for different info
    'also, without the advantages of .net sorting classes, the old bubble sorting is not the funnest

    Sub enumImages(fileName)
    Dim colFilelist, objFile, strButtons, objShortcut, colTargetList, objTarget, x, y, strKey, strItem
    ReDim arrButtons(1,-1)

    'reset display element style
    details.innerHTML = ""
    details.style.visibility = "hidden"
    ' strButtons = "<table id=buttonTable>"
    'enumerate ghost image shortcuts in specific images subfolder from enumDirs
    Set colFileList = objWMIService.ExecQuery _
    ("ASSOCIATORS OF {Win32_Directory.Name='z:\winpe\" & fileName & "'} Where ResultClass = CIM_DataFile")
    'find ghost image shortcut targetpath (fso)
    For each objFile in colFileList
    If objFile.Extension = "lnk" Then
    Set objShortcut = objShell.CreateShortcut(objFile.name)
    'find ghost image shortcut target (wmi)
    Set colTargetList = objWMIService.ExecQuery _
    ("Select * from CIM_Datafile Where name = '" & replace(objShortcut.targetpath,"\","\\") & "'")
    'add radio button label (from fso) and radio button target (from wmi) to an array
    For each objTarget in colTargetList
    ReDim Preserve arrButtons(1,UBound(arrButtons,2)+1)
    arrButtons(0,UBound(arrButtons,2)) = objShortcut.Description
    arrButtons(1,UBound(arrButtons,2)) = "<Input type=radio name=radioList id='" & objTarget.Drive & objTarget.Path & objTarget.fileName &_
    "' onClick=showRadioInfo>" & objShortcut.Description & "</BUTTON><BR>"
    Next
    End If
    Next
    'perform a a shell sort of the string array based on button label
    For x = 0 To UBound(arrButtons,2) - 1
    For y = x To UBound(arrButtons,2)
    If StrComp(arrButtons(0,x),arrButtons(0,y),vbTextCompare) > 0 Then
    strKey = arrButtons(0,x)
    strItem = arrButtons(1,x)
    arrButtons(0,x) = arrButtons(0,y)
    arrButtons(1,x) = arrButtons(1,y)
    arrButtons(0,y) = strKey
    arrButtons(1,y) = strItem
    End If
    Next
    Next
    'create combined buttons html code from sorted buttons array
    For x = 0 To UBound(arrButtons,2)
    strButtons = strButtons & "<tr><td id=buttonTd>" & arrButtons(1,x) & "</td></tr>"
    Next
    ' strButtons = strButtons & "</table>"
    'create a start button with start image command and append and post resulting html to body
    body.innerHTML = strBody & strButtons & "<BR><HR><BR><button id=start Accesskey=S onclick=doTask(strTaskValue)><U>S</U>tart Image!</BUTTON><BR>"
    start.style.visibility="hidden"
    End Sub

    FoldersWizard.ppt

×
×
  • Create New...