Windows 7 VBS Not Accepting Arguments

Discussion in 'Programming and Scripting' started by grahamc, Jul 5, 2011.

  1. grahamc

    grahamc New Member

    Jul 5, 2011
    Likes Received:
    I have a simple script that will copy the path of a file to the clipboard, when the file is dropped onto the script. The script works perfectly fine in Windows 7 and a normal XP box. However, in XP Mode the script will not accept the argument. Has anybody run into this, and found a way to rectify the issue?

    set oFso = createobject("scripting.filesystemobject")
    set oAutoit = createobject("autoitx3.control")

    sSource = wscript.arguments(0)
    set oFile = oFso.getfile(sSource)
    oAutoit.clipput oFile.path

    set oFile = nothing
    set oAutoit = nothing
    set oFso = nothing

Share This Page