2017-03-25 4 views
-1

Ich versuche, ein Vb-Skript, das eine Anwendung öffnet und klickt dann in Set-Spots, um die App zum Funktionieren zu bekommen und dann nach 15 Minuten das Programm, aber ich nicht wissen wie und kann nicht herausfinden, wie man es zur Arbeit bringt.Ausführen und Schließen eines Programms auf einer Zeitachse VBS

Ich habe dies so weit,

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 

Antwort

0

Bewegen der Maus und zwingt Mausklicks können eine hostile user environment erstellen.

Sie können versuchen, diese jedoch:

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") 

Sie müssen es in vb.NET tun kann, da VBS nicht viele Funktionen nicht unterstützt, die vb.NET tut, und man kann es einpacken in eine ausführbare Datei.

Weitere Informationen zum Force-Mausklick-Verfahren: https://bytes.com/topic/visual-basic/answers/641974-force-mouse-click

Verwandte Themen