-
Posts
239 -
Joined
-
Last visited
Everything posted by david1337
-
Weird Script Execution Issue
david1337 replied to copyleft's topic in AutoIt General Help and Support
What happens if you start it from Windows Task Scheduler based on time. Let's say in 3 minutes from now? Does it act differently than running it at logon? -
Passing parameter as variable in Run function
david1337 replied to max23ed's topic in AutoIt General Help and Support
You're welcome -
Passing parameter as variable in Run function
david1337 replied to max23ed's topic in AutoIt General Help and Support
Hi max23ed, Try with Shellexecute. ShellExecute("ussf.exe", $abc) -
Switching App Without Losing Keyboard/Mouse Focus
david1337 replied to GeekA's topic in AutoIt General Help and Support
I just tested with the Chrome windows running in full-screen. Still working! -
Switching App Without Losing Keyboard/Mouse Focus
david1337 replied to GeekA's topic in AutoIt General Help and Support
Hi GeekA, That is weird - when I have this script running, and have notepad opened, I don't lose focus in Notepad. I can type inside the notepad window, and there is no interruption? 😏 -
Switching App Without Losing Keyboard/Mouse Focus
david1337 replied to GeekA's topic in AutoIt General Help and Support
Hi GeekA, WinActivate will always take the focus. How about using WinSetState -> Minimize/Maximize like this, to cycle through your Chrome windows without taking focus: #include <Constants.au3> AutoItSetOption("WinTitleMatchMode", $OPT_MATCHANY) ;2 $Title1 = "[TITLE: ChromeTitle1;CLASS:Chrome_WidgetWin_1]" $Title2 = "[TITLE: ChromeTitle2;CLASS:Chrome_WidgetWin_1]" $Title3 = "[TITLE: ChromeTitle3;CLASS:Chrome_WidgetWin_1]" $Title4 = "[TITLE: ChromeTitle4;CLASS:Chrome_WidgetWin_1]" WinSetState($Title1,"", @SW_MINIMIZE) WinSetState($Title2,"", @SW_MINIMIZE) WinSetState($Title3,"", @SW_MINIMIZE) WinSetState($Title4,"", @SW_MINIMIZE) While 1 WinSetState($Title1,"", @SW_RESTORE) WinSetState($Title2,"", @SW_MINIMIZE) WinSetState($Title3,"", @SW_MINIMIZE) WinSetState($Title4,"", @SW_MINIMIZE) Sleep(3000) WinSetState($Title2,"", @SW_RESTORE) WinSetState($Title1,"", @SW_MINIMIZE) WinSetState($Title3,"", @SW_MINIMIZE) WinSetState($Title4,"", @SW_MINIMIZE) Sleep(3000) WinSetState($Title3,"", @SW_RESTORE) WinSetState($Title1,"", @SW_MINIMIZE) WinSetState($Title2,"", @SW_MINIMIZE) WinSetState($Title4,"", @SW_MINIMIZE) Sleep(3000) WinSetState($Title4,"", @SW_RESTORE) WinSetState($Title1,"", @SW_MINIMIZE) WinSetState($Title2,"", @SW_MINIMIZE) WinSetState($Title3,"", @SW_MINIMIZE) Sleep(3000) WEnd - David -
Script to open a fullscreen image?
david1337 replied to DojoBaggins's topic in AutoIt General Help and Support
Hi Compile your script to an exe file, and go to properties on that exe file. Play around with the DPI settings to make it use the DPI of the program and not your Windows 300% scaling. Now run your script from the exe file, and see if that does the trick -
Okay, well then you just call the function inside your While loop? HotKeySet("{ESC}", "End") ;~ HotKeySet("{F1}", "Get_Mouse_Pos") $GUI = GUICreate("Coords", 60, 30, 0, 0) $Label_x_y = GUICtrlCreateLabel("x=" & @CRLF & "y=", 1, 0, 15, 30) $Label_x_value = GUICtrlCreateLabel("", 17, 0, 50, 13) $Label_y_value = GUICtrlCreateLabel("", 17, 15, 50, 13) GUISetState(@SW_HIDE) While 1 Sleep(100) Get_Mouse_Pos() ;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< WEnd Func Get_Mouse_Pos() GUISetState(@SW_SHOW) $Mpos = MouseGetPos() $Mpos_x = $Mpos[0] $Mpos_y = $Mpos[1] GUICtrlSetData($Label_x_value, $Mpos_x) GUICtrlSetData($Label_y_value, $Mpos_y) EndFunc Func End() Exit EndFunc
-
Hi Something like this? HotKeySet("{ESC}", "End") HotKeySet("{F1}", "Get_Mouse_Pos") $GUI = GUICreate("Coords", 60, 30, 0, 0) $Label_x_y = GUICtrlCreateLabel("x=" & @CRLF & "y=", 1, 0, 15, 30) $Label_x_value = GUICtrlCreateLabel("", 17, 0, 50, 13) $Label_y_value = GUICtrlCreateLabel("", 17, 15, 50, 13) GUISetState(@SW_HIDE) While 1 Sleep(100) WEnd Func Get_Mouse_Pos() GUISetState(@SW_SHOW) $Mpos = MouseGetPos() $Mpos_x = $Mpos[0] $Mpos_y = $Mpos[1] GUICtrlSetData($Label_x_value, $Mpos_x) GUICtrlSetData($Label_y_value, $Mpos_y) EndFunc Func End() Exit EndFunc
-
Running script from string
david1337 replied to Script_Kiddie's topic in AutoIt General Help and Support
Hi You should use Execute $Variable = 'MsgBox(0,"","Hello")' Execute($Variable) -
AutoIt Malfunction While the Window is minimised.
david1337 replied to Lourdson's topic in AutoIt General Help and Support
That sounds weird. Does the same happen if you use Send("D:") instead of ControlSend("C:\WINDOWS\system32\cmd.exe", "", "", "D:") ? -
RunAs "by hand" works, "RunAs()" command fails?
david1337 replied to Roman's topic in AutoIt General Help and Support
Hi roman Can you please show your code? -
Anyone can help me with autologin scripts?
david1337 replied to ransej's topic in AutoIt General Help and Support
Hi ransej, Please post the code you have so far. -
Hi abokdl, Sorry, but that is the weirdest explanation ever I am quite sure that it's easy to create a script that does what you want, but nobody understands what that is. So let's say you are going to type "Hello people" it would look like "Hello people3" Typing "Hello people" where? Notepad?... And it would only be "Hello people3" if you hit ENTER after, right? and when I press 1 it should look like "Hello people" It should change the existing "Hello people3" to "Hello people" or just write a new "Hello people" ? Please try to explain what you are trying to achieve a little better, and I will be glad to help you - David
-
jriker1, Yes that is pretty easy to achieve Change $Application_ProcessName and $Application_FullPath to match your application. #NoTrayIcon $USB_Drive = 'E:\' ; <-- change to match the drive letter of your USB stick :-) $Videos_Folder = 'C:\Videos' $Application_ProcessName = "chrome.exe" $Application_FullPath = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" While 1 $Check_drive = FileExists($USB_Drive) Sleep(500) If $Check_drive = 1 Then ConsoleWrite("USB Stick is active..." & @CRLF) ProcessClose($Application_ProcessName) ProcessWaitClose($Application_ProcessName) DirRemove($Videos_Folder, 1) DirCreate($Videos_Folder) SplashTextOn("", "Copying files...", 300, 55, -1 , -1, 1, "@calibri", "16","600") FileMove($USB_Drive & "\*.*", $Videos_Folder, 1) ;Move all source files first $hSearch = FileFindFirstFile($USB_Drive & "\*.*") ;Now find any remaining (in this case: folders) if $hSearch = -1 then exit ;No folders While 1 $hFilename = FileFindNextFile($hSearch) if @ERROR then exitloop ;No more files DirMove($USB_Drive & "\" & $hFilename, $Videos_Folder,1);move subdir and all contents to new location WEnd SplashOff() Sleep(500) SplashTextOn("", "Copy complete", 300, 55, -1 , -1, 1, "@calibri", "16","600") Sleep(5000) SplashOff() Do $Check_drive = FileExists($USB_Drive) ConsoleWrite("Waiting for USB Stick to be removed again..." & @CRLF) Sleep(500) Until $Check_drive = 0 ShellExecute($Application_FullPath) Else ConsoleWrite("USB Stick is NOT active..." & @CRLF) EndIf WEnd
-
Hi jriker1 Something like this? What my script does: 1. Waits for the USB stick to be inserted 2. Deletes all contents of C:\Videos 3. Moves all contents (including folders etc.) from your USB stick to C:\Videos 4. Waits for you to remove the USB stick again, and when you do, the script continues.. Just set the script to start up with windows. #NoTrayIcon $USB_Drive = 'E:\' ; <-- change to match the drive letter of your USB stick :-) $Videos_Folder = 'C:\Videos' While 1 $Check_drive = FileExists($USB_Drive) Sleep(500) If $Check_drive = 1 Then ConsoleWrite("USB Stick is active..." & @CRLF) DirRemove($Videos_Folder, 1) DirCreate($Videos_Folder) SplashTextOn("", "Copying files...", 300, 55, -1 , -1, 1, "@calibri", "16","600") FileMove($USB_Drive & "\*.*", $Videos_Folder, 1) ;Move all source files first $hSearch = FileFindFirstFile($USB_Drive & "\*.*") ;Now find any remaining (in this case: folders) if $hSearch = -1 then exit ;No folders While 1 $hFilename = FileFindNextFile($hSearch) if @ERROR then exitloop ;No more files DirMove($USB_Drive & "\" & $hFilename, $Videos_Folder,1);move subdir and all contents to new location WEnd SplashOff() Sleep(500) SplashTextOn("", "Copy complete", 300, 55, -1 , -1, 1, "@calibri", "16","600") Sleep(5000) SplashOff() Do $Check_drive = FileExists($USB_Drive) ConsoleWrite("Waiting for USB Stick to be removed again..." & @CRLF) Sleep(500) Until $Check_drive = 0 Else ConsoleWrite("USB Stick is NOT active..." & @CRLF) EndIf WEnd /David
-
Auto space bar program (pls help)
david1337 replied to jeremyroberts's topic in AutoIt General Help and Support
Hi jeremyroberts With this you can use F1 to pause and unpause Global $Paused HotKeySet("{F1}", "TogglePause") While 1 Send("{SPACE}") sleep(25) WEnd While 1 Sleep(100) WEnd ;;;;;;;; Func TogglePause() $Paused = Not $Paused While $Paused Sleep(100) ToolTip('Script is "Paused"', 0, 0) WEnd ToolTip("") EndFunc -
#include <String.au3> $FQDN1 = "CN=Hostname01,OU=Floor,OU=Computers,OU=Mumbai,DC=Domain,DC=com" $FQDN2 = "CN=Hostname02,OU=Training Computers,OU=Floor,OU=Computers,OU=Mumbai,DC=Domain,DC=com " $FQDN1_a = _StringBetween($FQDN1,"CN=Hostname01,OU=Floor,OU=Computers,OU=", ",DC=Domain,DC=com")[0] $FQDN1_b = _StringBetween($FQDN1,"CN=Hostname01,OU=Floor,OU=", ",OU=Mumbai,DC=Domain,DC=com")[0] $FQDN1_c = _StringBetween($FQDN1,"CN=Hostname01,OU=", ",OU=Computers,OU=Mumbai,DC=Domain,DC=com")[0] $FQDN2_a = _StringBetween($FQDN2,"CN=Hostname02,OU=Training Computers,OU=Floor,OU=Computers,OU=", ",DC=Domain,DC=com")[0] $FQDN2_b = _StringBetween($FQDN2,"CN=Hostname02,OU=Training Computers,OU=Floor,OU=", ",OU=Mumbai,DC=Domain,DC=com")[0] $FQDN2_c = _StringBetween($FQDN2,"CN=Hostname02,OU=Training Computers,OU=", ",OU=Computers,OU=Mumbai,DC=Domain,DC=com")[0] $FQDN2_d = _StringBetween($FQDN2,"CN=Hostname02,OU=", ",OU=Floor,OU=Computers,OU=Mumbai,DC=Domain,DC=com ")[0] MsgBox(0,"FQDN1", $FQDN1_a & "\" & $FQDN1_b & "\" & $FQDN1_c) MsgBox(0,"FQDN2", $FQDN2_a & "\" & $FQDN2_b & "\" & $FQDN2_c & "\" & $FQDN2_d)
-
Hmm I don't see anything wrong in that code. This works fine here - The MsgBox gives me the URL. Have you tried with different sites? #include <MsgBoxConstants.au3> send ("!d") ;select URL in browser send ("^c") ;copy selected URL Local $NewURL = ClipGet() Local $sTitle = "Title" MsgBox($MB_ICONINFORMATION + $MB_TOPMOST, $sTitle, $NewURL )
-
Okay, I think we need more of the source code to tell what is going on. You can post it if you don't find another solution.
-
Okay, very weird that it is able to call executables directly from the mapped drive, when the drive is not visible. When the script has run, and the drive is not visible, are you still able to call the same executables manually from "run" ?
-
If you place a consoleswrite or msgbox just before the "DriveMapDel", do you get the expected output from the msgbox? Like this: $remoteShare = "\\" & GUICtrlRead($serverName) & "\RNAPGM" $remoteShare = String($remoteShare) MsgBox(0,"",$remoteShare) DriveMapDel("N:") DriveMapAdd("N:", $remoteShare)
-
Run powershell script with AutoIt
david1337 replied to david1337's topic in AutoIt General Help and Support
AdamUL, Perfect, that worked! Thank you so much