2 posts in this topic
How are you
I have a question, please.
I've created a window and i need
when i run the script if it detect an other copy from the same script was runing
the script close the first copy Automatically and run a new copy
I want an example to understand it
I am attempting to run an Autoit.exe with schtasks every weekday @ 9:05 am.
I have the below
C:\>SchTasks /Create /TN "P10Run" /TR "O:\AUTOIT\P40 Run.au3" /SC WEEKLY /D MON, TUE,WED,THU,FRI /ST 09:05:00 SUCCESS: The scheduled task "P10Run" has successfully been created. I also did a "test" run :
C:\>Schtasks /Run /TN "P10Run SUCCESS: Attempted to run the scheduled task "P10Run". But when I run my query to verify success my "Last Result" seems to indicate that the script did not run:
C:\>SCHTASKS /QUERY /FO LIST /V /TN "P10RUN" Folder: \ HostName: xxxxxxxxxxxxxxxx TaskName: \P10RUN Next Run Time: N/A Status: Could not start Logon Mode: Interactive only Last Run Time: 6/14/2017 9:08:56 AM Last Result: -2147024894 Author: xxxxxxx Task To Run: O:\AUTOIT\P40 Run.au3 Start In: N/A Comment: N/A Scheduled Task State: Enabled Idle Time: Disabled Power Management: Stop On Battery Mode, No Start On Batterie s Run As User: xxxxxxxxx\xxxxxxxx Delete Task If Not Rescheduled: Enabled Stop Task If Runs X Hours and X Mins: 72:00:00 Schedule: Scheduling data is not available in this f ormat. Schedule Type: Weekly Start Time: 9:05:00 AM Start Date: 6/14/2017 End Date: N/A Days: MON, TUE, WED, THU, FRI Months: Every 1 week(s) Repeat: Every: Disabled Repeat: Until: Time: Disabled Repeat: Until: Duration: Disabled Repeat: Stop If Still Running: Disabled C:\> Is there something missing in my command? Also is there a better way to make sure that the script does in fact sun successfully?
Thanks In Advance!
Looking for working code to get full path of process - both 32 & 64 bit.
I tryed this bellow, but it works only for 32-bit processes, even if compiled for x64...
Thanx for suggestions!
Func _ProcessGetPath($vProcess) ;get the program path done by MrCreatoR Local $iPID = ProcessExists($vProcess) If NOT $iPID Then Return SetError(1, 0, -1) Local $aProc = DllCall('kernel32.dll', 'hwnd', 'OpenProcess', 'int', BitOR(0x0400, 0x0010), 'int', 0, 'int', $iPID) If NOT IsArray($aProc) OR NOT $aProc Then Return SetError(2, 0, -1) Local $vStruct = DllStructCreate('int') Local $hPsapi_Dll = DllOpen('Psapi.dll') If $hPsapi_Dll = -1 Then $hPsapi_Dll = DllOpen(@SystemDir & '\Psapi.dll') If $hPsapi_Dll = -1 Then $hPsapi_Dll = DllOpen(@WindowsDir & '\Psapi.dll') If $hPsapi_Dll = -1 Then Return SetError(3, 0, '') DllCall($hPsapi_Dll, 'int', 'EnumProcessModules', _ 'hwnd', $aProc, _ 'ptr', DllStructGetPtr($vStruct), _ 'int', DllStructGetSize($vStruct), _ 'int_ptr', 0) Local $aRet = DllCall($hPsapi_Dll, 'int', 'GetModuleFileNameEx', _ 'hwnd', $aProc, _ 'int', DllStructGetData($vStruct, 1), _ 'str', '', _ 'int', 2048) DllClose($hPsapi_Dll) If NOT IsArray($aRet) OR StringLen($aRet) = 0 Then Return SetError(4, 0, '') Return $aRet EndFunc
What command would I use to open the following folder directories for:
Computer/This PC (windows 7/Windows 10)
Run("Explorer.exe " & $filepath) ShellExecute($filepath) can be used to open folder locations when you type in the full directory such as "C:\Users\%username%\Documents" but I'm trying to figure out how to use these windows short paths.
I'm attempting to code a Run or RunWait command that is a little on the long side and contains multiple sets of embedded quotes (as it would be issued from a CMD prompt), but can't for the life of me figure out the containing quotes as pertains to AutoIt. Here's the one-line command as it would be issued via a CMD prompt...
"\\AppServ\G$\Connectivity\Clients\Citrix\Receiver\220.127.116.1118\CitrixReceiver.exe" ADDLOCAL="ReceiverInside,ICA_Client,WebHelper,SSON,AM,SELFSERVICE,USB,DesktopViewer,Flash,Vd3d" ALLOWADDSTORE=A ALLOWSAVEPWD=A ENABLEPRELAUNCH=Y ENABLE_SSON=Yes STORE0="AppStore;https://receiver.domain.net/Citrix/Apps/discovery;on;AppStore" /EnableCEIP=false /includeSSON /noreboot /silent I've tried so many different combinations of surrounding quotes with Run and RunWait, I just don't understand why it's this difficult to get past this.
Can anyone assist with this?