Function() to obtain a Disk File

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

dlipman

Thread Starter
Joined
Feb 14, 2013
Messages
373
First Name
David
I created the following KiXtart Function() to obtain a Disk File. It works but because I am using MSHTA the GUI defaults to displaying "Choose File to Upload" which belies the context in which I use it.

Any alternate suggestions for a GUI function that obtains/selects a Disk File ?

Code:
Function SelectFile()
   Dim $objSHELLexec, $CMD, $objSHELL
   $SelectFile=""
   $CMD='mshta.exe "about:<input type=file id=FILE><script>FILE.click();new ActiveXObject("Scripting.FileSystemObject").GetStandardStream(1).WriteLine(FILE.value);close();resizeTo(0,0);</script>" '
   $objSHELL=CreateObject("WScript.Shell")
   $objSHELLexec=$objSHELL.Exec($CMD)
   $SelectFile=$objSHELLexec.StdOut.ReadLine()
EndFunction
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top