最初に悪いタイトルで申し訳ありません。誰かがこの質問にもっと良い名前を付けることができれば、してください。
私はこのHTMLファイルを持っています:
<html>
<form action='' method='post'>
<input id='inbox' type='file' />
<input id='outbox' type='button' onclick='alert(inbox.value);'
value='submit' />
</form>
</html>
IE で開き、ファイルを参照して [送信] ボタンをクリックすると、選択したファイルへのフル パスが表示されます。しかし、VBScript で同じスクリプトを作成しようとすると、次のようになります。
Set IE = CreateObject("InternetExplorer.Application")
IE.Offline = True
IE.Navigate "about:blank"
Do
Loop While IE.Busy
html = "<html>" &_
" <form action='' method='post'>" &_
" <input id='inbox' type='file' />" &_
" <input id='outbox' type='button' onclick='alert(inbox.value);'" &_
" value='submit' />" &_
" </form>" &_
"</html>"
IE.Document.write html
IE.Width = 0
IE.Height = 0
IE.Document.All("inbox").Click
IE.Document.All("outbox").Click
悪名高いc:\fakepath\file.ext
メッセージで警告されます。
これがなぜなのか、それを克服する方法がさらに良いのか、誰かが考えを持っていますか?