2017-03-25 13 views
-1

アプリケーションを開いて設定したスポットをクリックしてアプリが動作するようにするVBスクリプトを作成しようとしていますが、15分後にプログラムは終了しますが、どのようにそれを働かせるかを知ることはできません。タイムラインでのプログラムの実行と終了VBS

私はこれまでのところ、

Set WshShell = WScript.CreateObject("WScript.Shell") 
WshShell.Run "C:\Users\Owner\Downloads\Codin\Codin\Codin.exe" 
//Now it doesn't run for some reason, it won't open the program in my downloads? 
//right here is where I'd put the script for the clicking on certain areas 
//then put the time script above this 
Set WshShell = WScript.CreateObject("Wscript.Shell") 
WshShell.run "C:\Users\Owner\Downloads\Codin\Codin.bat\\ 
//The .bat file is to run 
@ECHO OFF 
TASKKILL /F /IM Codin.exe 

答えて

0

は、マウスを動かすとhostile user environmentを作成することができ、マウスのクリックを強制的にこれを持っています。

ただし、これを試すことができます。

Public Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dX As Long, ByVal dY As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long) 
Process.Start("C:\Users\Owner\Downloads\Codin\Codin\Codin.exe") 
Dim x As Integer = 150 ' The x position on the screen 
Dim y As Integer = 150 ' The y position on the screen 
Cursor.Position = New Point(x, y) 
mouse_event MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_LEFTUP, x, y, 0, 0 
Application.DoEvents() 
Threading.Thread.Sleep(900000) ' Sleep 900,000 milliseconds, or 15 minutes 
Process.Start("C:\Users\Owner\Downloads\Codin\Codin.bat") 

あなたはVBSがvb.NETはない多くの機能をサポートしていないため、vb.NETでそれをしなければならないこと、そしてあなたがそれを包むことができます実行可能ファイル。

フォースマウスのクリック方法の詳細:https://bytes.com/topic/visual-basic/answers/641974-force-mouse-click

関連する問題