こんにちは、vbscript を使用してさまざまなインターネット ページやプログラムを開くスクリプトを作成しようとしていますが、ネットワーク ドライブにある PDF ファイルを開くのに苦労しています。一連のコマンドを試しましたが、ファイルを開くことができません。まったく、どんな助けでも大歓迎です:)
Set IE = CreateObject("InternetExplorer.Application")
set WshShell = WScript.CreateObject("WScript.Shell")
IE.Navigate "https://websiteaddress.com
IE.Visible = True
Wscript.Sleep 3000
WshShell.SendKeys "text"
WshShell.SendKeys "{ENTER}"
Wscript.Sleep 3000
WshShell.SendKeys "text"
WshShell.Sendkeys "{TAB}"
WshShell.Sendkeys "{TAB}"
WshShell.Sendkeys "text"
WshShell.SendKeys "{ENTER}"
Wscript.Sleep 3000
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{ENTER}"
Wscript.Sleep 3000
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{ENTER}"
Wscript.Sleep 3000
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{ENTER}"
Wscript.Sleep 3000
WshShell.SendKeys "%{TAB}"
WshShell.SendKeys "%{F4}"
Wscript.Sleep 3000
WshShell.SendKeys "%{TAB}"
IE.Navigate "https://websiteaddress.com"
IE.Visible = True
Wscript.Sleep 3000
WshShell.SendKeys "text"
WshShell.SendKeys "{ENTER}"
Wscript.Sleep 3000
WshShell.Run "H:\Shortcuts /k dir *.*"
WshShell.Run "Notepad.exe"
Wscript.Sleep 3000
WshShell.Run "calc.exe"
私はvbscriptingに非常に慣れていませんが、次の2行を試しましたが、どちらも機能しません。
WshShell.Run "G:\pathtofile\thepdf.pdf"
WshShell.Run "NET USE G: \\server\share\thepdf.pdf"