Jump to content

Search the Community

Showing results for tags 'windows'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Location


WWW


Interests

Found 47 results

  1. Hi, Does anyone knows why this command doesn't work? Run(@ComSpec & " /c " & "devcon.exe hwids * | findstr /R ""1050&PID_0114&REV_0340&MI_01"" || (rundll32.exe user32.dll, LockWorkStation)", "", "") This is the command in commandline: devcon.exe hwids * | findstr /R "1050&PID_0114&REV_0340&MI_01" && (echo USB Device is connected) || (rundll32.exe user32.dll, LockWorkStation) This works, but i want to convert this to AutoIT, but it doesn't work. In short what i am trying to accomplish is that a script checks every 1 sec. if there is an USB device plugged in and if not ( so it is removed ) it will lock Windows OS. Can someone help me with this?
  2. How do i pass the IE handle to an active windows authentication prompt when the IE shows it is " waiting " , right now it is nt detecting the windows security prompt I used the below to wait for it to load until the 60ms timeout but still it isnt working : #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Outfile=ps_test.exe #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <Constants.au3> #include <IE_v1.au3> If $CmdLine[0] < 2 Then MsgBox($MB_OK, "Usage", "ps_WAN <username> <password>") Else wan($CmdLine[1], $CmdLine[2]) EndIf Func wan($email, $password) $oIE = _IECreate() $ieo=_IENavigate($oIE, "https://cccc") _IELoadWait($ieo,0,60) Local $hWnd = WinExists("Windows Security") if $hWnd = 0 Then MsgBox($MB_OK, "Usage", "timeout") EndIf ControlFocus("Windows Security", "", "[CLASS:DirectUIHWND]") ControlFocus("Windows Security", "", "[CLASS:Edit; INSTANCE:1]")
  3. I have read the help files, and tried the example, but nothing is happening, I see some code 0,0,0,0 and changed settings, but the window does nothing. How can I change the parameters for window size and position, where in the code and how? #include <MsgBoxConstants.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> Example() Func Example() ; Assign a Local variable the handle of the NotePad window Local $hWnd = WinGetHandle("[CLASS:Notepad]") ; If the window does not exists, display a message and return False. If @error Then MsgBox($MB_SYSTEMMODAL, "", "Notepad window not found.") Return False EndIf ; Assign a Local variable the style of the Notepad window. Local $iStyle = _WinAPI_GetWindowLong($hWnd, $GWL_STYLE) ; Remove from the window style the MAXIMIZEBOX, MINIMIZEBOX and SIZEBOX styles. $iStyle = BitXOR($iStyle, $WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_SIZEBOX) ; Set the style of the window. _WinAPI_SetWindowLong($hWnd, $GWL_STYLE, $iStyle) ; Apply the style _WinAPI_SetWindowPos($hWnd, $HWND_TOP, 0, 0, 0, 0, BitOR($SWP_FRAMECHANGED, $SWP_NOMOVE, $SWP_NOSIZE)) EndFunc ;==>ExampleThanks
  4. I am using window XP in my desktop, so I want to convert basic disk to a dynamic disk, so how it is possible?
  5. Hello, I'm working on a script that writes detailed application event logs, and I'd like to know if there is a way with Autoit to write multiple lines of XML EventData (see example below): <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event"> <System> <Provider Name="Application" /> <EventID Qualifiers="0">1001</EventID> <Level>4</Level> <Task>0</Task> <Keywords>0x80000000000000</Keywords> <TimeCreated SystemTime="2015-07-12T21:26:07.000000000Z" /> <EventRecordID>86554</EventRecordID> <Channel>Application</Channel> <Computer>YOUR_COMPUTER</Computer> <Security /> </System> <EventData> <Data>DeskTop Agent: Mike</Data> <Data>Observer Username: Miguel</Data> etc... </EventData> </Event> So far, using EventCreate, everything I send end's up in a single <data> entry (see below): <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event"> <System> <Provider Name="Application" /> <EventID Qualifiers="0">1001</EventID> <Level>4</Level> <Task>0</Task> <Keywords>0x80000000000000</Keywords> <TimeCreated SystemTime="2015-07-12T21:26:07.000000000Z" /> <EventRecordID>86554</EventRecordID> <Channel>Application</Channel> <Computer>YOUR_COMPUTER</Computer> <Security /> </System> <EventData> <Data>DeskTop Agent: Mike Observer Username: Miguel</Data> </EventData> </Event> Here is the code I'm using thus far (which does not work the way I'd like): $LogData = @CRLF & "DeskTop Agent: " & @UserName & @CRLF & "Observer Username: " & $DTObserver & @CRLF & "File name/s with extension: " & $FilenameWextension & @CRLF & "Action Performed: " & $ActionPerformed & @CRLF & "Explanation: " & $Explanation & @CRLF & "Machine Name: " & @ComputerName & @CRLF & "IP Address: " & @IPAddress1 & @CRLF & "App1Installed: " & $App1 & @CRLF & "App2Installed: " & $App2 Run("eventcreate /T Information /ID 100 /L Application /SO DTALog /D " & Chr(34) & "DTALog Details: " & $LogData & Chr(34), "", @SW_HIDE, 2) I found a Stackoverflow post that talks about doing it in C# (https://stackoverflow.com/questions/7694276/how-to-add-multiple-lines-of-eventdata-to-an-eventlog-in-windows) but I'd like to determine if it can be accomplished with AutoIt!. Thanks for your time, -Mike
  6. Hi, I'm currently saving process time stamps of my employer's other employees and saving it in a text document as data storage. However, my employer wants it to be processed in a day to day basis to generate their average process time per day. How can I compare today from yesterday and so on and so forth with the succeeding days? Whats the best approach to this? Thank you. ~XN~
  7. Folks, I have an issue I've been trying to solve for a while, I'm trying to add static routes in DHCP via a 121 route rule in Windows 2012 R2 is a brutal manual process and wanted to automate this via AutoIT. When I use the "ControlGetText" everything displays properly in the MSG box but when I try and use "ControlSetText" or "ControlSend" the values won't display in the input box but the action comes back as successful? Anyone able to help me with this? I'm thinking this might be an active window issue but i'm not sure. Here is a part of my code. $hWnd = WinWait("[TITLE:Add a Static Route]","", 10) WinActivate($hWnd) $Status = ControlSend($hWnd, "", "[CLASS:Edit; INSTANCE:4]", "192"); Does not add 192 to the text box. Local $sTextEdit1 = ControlGetText($hWnd, "", "[CLASS:Edit; INSTANCE:1]") ConsoleWrite ( "ControlSend Status: " & $Status & @CRLF); Returns a Value of 1 ConsoleWrite ( "ControlGetText Value Edit1: " & $sTextEdit1 & @CRLF); Please see attachment for more info.
  8. i am working on a application where if the flashing is success i get a window saying "SUCCESS" and if the flashing failed a window saying "FAILED" and i have to automatically identify pass or fail.the problem is both the windows are having the same control ID. how can i differentiate between both windows? so that i can make use of that in script for automation/// Thanks
  9. Hello! I created some scripts for a simple farming bot a few years ago and they rely on ControlSend. A year ago I quit that game and then installed Windows 10 (was using windows 7). Recently I installed that game and tried running them again and they seem to work (I have some messages displayed on the screen with the state of the bot ), except for the ControlSend part (which obviously is crucial). I started debugging the scripts so I created a basic script that makes use of Send. I tested this with Notepad in focus and works just fine and then with my game window in focus and it didn't work (it's supposed to write that text in an input box from the game). #include <MsgBoxConstants.au3> Sleep(3000); Send("some text"); MsgBox($MB_OK, "Notification", "Control was sent!"); Is there a way for the creators of the game to create some kind of security system against this? Or something happens because I updated to Windows 10? Is there something I'm missing? Thank you!
  10. Recently, I am interested to build a windows app to reset Windows login password as a side off project. I am still a newbie in programming so i am not able to build the app from scratch. Is there any open source project i could learn from on this?
  11. Hi dear I have a question about the display language of the system How can I get the current display language and how can I change it by autoit Of course, if this is possible Greetings to all and hope you help me
  12. AutoIT AU3info doeas not detect all gui objects uniquely for .NET GUIs developed in C#. this is not working now i am using COM windows approach for this, But its very difficult. Please let me know if anyone has done it before.
  13. With _WinWaitActivate we can wait for a window to process it. But is there any logic so that we can wait for this window title and based on the window text (like 2 or more patterns will be there) we can click yes or no on the window. Func _WinWaitActivate($title,$text,$timeout=0) WinWait($title,$text,$timeout) If Not WinActive($title,$text) Then WinActivate($title,$text) WinWaitActive($title,$text,$timeout) EndFunc
  14. I am trying to spawn a cmd.exe shell on a remote machine using psexec then proceed to running commands on that machine and reading the output. I.e. running pwd. Unfortunately, the code I have now will just immediately exit cmd on the remote system I'm trying to use the current code #include <Constants.au3> $pid = Run('C:\Users\test\Desktop\psexec.exe \\192.168.1.123 -u test -p "P@$$word1" -h -s cmd',@SystemDir, @SW_HIDE, $STDIN_CHILD + $STDOUT_CHILD) StdinWrite($pid,"pwd") StdinWrite($pid,@CRLF) Local $data Sleep(2000) $data &= StdoutRead($pid) ConsoleWrite("Debug:" & $data & @LF) StdinWrite($pid,"cd ") StdinWrite($pid,"C:\users\test2") StdinWrite($pid,@CRLF) StdinWrite($pid) $data &= StdoutRead($pid) ConsoleWrite("Debug:" & $data & @LF) http://stackoverflow.com/questions/19206834/command-prompt-and-autoit-stdinwrite <- credits to this stack overflow post Unfortunately, on my end, my cmd just starts/stops with this prompt Connecting with PsExec service on 192.1.123...Starting cmd on 192.168.1.123... cmd exited on 192.168.1.123 with error code 0. Any ideas how I can keep my shell open over psexec and still interact with it using AutoIT? Any feed back would be amazing! Thanks!
  15. If I create a service to run a program , Application window cannot Appear - How can I make the App window visible
  16. Whenever we try to access a network share it will prompt for credentials based on the shared folder settings. Like the below prompt Once you save them, they are saved in Windows Credentials of Credentials Manager in Control panel (run --> control keymgr.dll). But not able to found exact file or registry for this setting. So, can anyone suggest how to do this process of adding network credentials using AutoIT.
  17. Basically, I want to unlock a user account by executing a script (while a user see's their locked screen, if this script is executed in the background, it unlocks their account without having to type in any password). In a perfect world, I would have a service running that can automatically log specific users in whether their account is locked or they just turned their computer on and no users have been logged in yet. I don't want to have anything special enabled on the computer (like the remote desktop workaround). I can provide the actual password to the account and I would like this to be compatible on Windows 7. Has anyone come across any script that can do this? If there isn't a way to unlock the computer from startup, is there at least a way to unlock the account that's currently already logged into but just has the lock screen up?
  18. Hello. I'm building a script to install some windows updates with a GUI. For this, the script need to know witch windows version to work: Windows 7, Windows 7 SP1, Windows 8, Windows 8.1 and so on. I read this article, but it don't list Windows 10 Anniversary Edition. So, I run into build version, because they are different between them. The first is 10586, and Anniversary is 14393. So, somewhere on my script I have this: If @OSVersion = 'win_10' Then $versao_windows = 'Windows 10' ElseIf @OSVersion = 'win_10' And @OSBuild = 14393 Then $versao_windows = 'Windows 10 Edição De Aniversário' $win10ae = 1 EndIf As you see, "$versao_windows" is the "friendly" name to be showed on the GUI, and "$win10ae" will be the variable to be used to distinguish the windows version to use. But the script still showing the 'normal' Windows 10 version, even if it is running on Anniversary Edition. On the status bar, it rightly shows the 14393 build, but don't shows "Windows 10 Edição De Aniversário". I need this to install the correct updates, because they are different from one build to another. Where I'm wrong on my code? Thanks in advice!
  19. Hey guys! I need your help again. So I am working on a Project with which I can Logoff a User in a Terminal-Server (Windows Server 2012 R2), logged in as Admin. Then backup the users partition and log him back in. Sounds pretty easy for you guys, right? So my problem is... I seem to not be able to get the User ID. You can see and display the ID in a textfile with: Run("query user>>c:\users\example\desktop\helpmeguys.txt") This line just writes a textfile of "query user" on the desktop. This is an example on what it looks like: BENUTZERNAME SITZUNGSNAME ID STATUS LEERLAUF ANMELDEZEIT >wg console 2 Aktiv 17 25.07.2016 08:19 What I need right now is the ID. Any Idea on how to read it off of the Textfile? Please give me examples because I am still a rookie! With kind regards Eddi96
  20. Hi! I post here because i was wonderring if someone in this forum could help me with my script. What i'm trying to do, is to basically install a new keyboard layout in Windows and activate it. I want to acheive by the registry or the command line, but not with the autoit automation tools, i don't find it stable... Thanks for your help and have a good day!
  21. Hi My new Win10 PC has decided that I am not allowed to create OpenOffice text or spreadsheet documents, but some other stuff I never use. I would like advice on how to customize the "New" context(?) menu in the Windows Explorer "New" submenu. I attach a screenshot. Essentially, how do I customize that item?
  22. I recently upgraded my laptop to one with Windows 10 and higher screen resolution. In the process I found that some of my scripts did not work right when using Autoit's @DesktopWidth and @DesktopHeight macros. Insteat of 1920 x 1080 resolution Autoit detects 1536 x 864. Thus, GUIs designed to appear near the right edge of the screen displayed closer to the horizontal middle of the screen. I assume others may have the same problem. A search on this forum and Microsoft Script Center helped me to write the following script that gets the true screen width and height from WMI. MsgBox(0, '', _GetMonitorInfo()) Func _GetMonitorInfo() Local $oWMI, $Listing, $sWidth = 0, $sHeight = 0 $oWMI = ObjGet("winmgmts:\\" & @ComputerName & "\root\CIMV2") If IsObj($oWMI) Then $Listing = $oWMI.ExecQuery("SELECT * FROM Win32_DesktopMonitor") If IsObj($Listing) Then For $oItem In $Listing $sHeight = $oItem.ScreenHeight $sWidth = $oItem.ScreenWidth Next EndIf EndIf Return "Width: " & $sWidth & @CRLF & "Height: " & $sHeight EndFunc ;_GetMonitorInfo Hopefully it will benefit others. I for sure am very happy with all the samples I been able to find here in the past.
  23. I have written and autoit script and it works perfectly. However I need it to run using windows task scheduler. The first thing it does is open up a Microsoft access database. I use the shellExecute command to open the database ie ShellExecute("\\myServer\Data\Documents\Reports.accdb") However when I run the script from the windows task scheduler the access database does not open. The rest of the script runs fine. How do I get this to work? Thanks Simon
  24. I'm trying to run this code: #include <GuiListView.au3> #include <GUIConstants.au3> Dim $Services Dim $ServicesList #cs While 1 CheckService() Sleep(30000) ; sleep 30 seconds WEnd #ce ;#cs #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <TabConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 615, 438, 192, 124) $Tab1 = GUICtrlCreateTab(0, 48, 609, 385) $TabSheet1 = GUICtrlCreateTabItem("Running Services") $ListView1 = GUICtrlCreateListView("Service Name|Status", 8, 72, 593, 281, -1, BitOR($LVS_EX_GRIDLINES,$LVS_EX_CHECKBOXES,$LVS_EX_FULLROWSELECT)) GUICtrlSendMsg($ListView1, $LVM_SETCOLUMNWIDTH, 0, 300) GUICtrlSendMsg($ListView1, $LVM_SETCOLUMNWIDTH, 1, 288) $Button1 = GUICtrlCreateButton("Stop Services", 464, 376, 129, 33) $TabSheet2 = GUICtrlCreateTabItem("Stopped Services") GUICtrlSetState(-1,$GUI_SHOW) $ListView2 = GUICtrlCreateListView("Service Name|Status", 8, 72, 593, 281, -1, BitOR($LVS_EX_GRIDLINES,$LVS_EX_CHECKBOXES,$LVS_EX_FULLROWSELECT)) GUICtrlSendMsg($ListView2, $LVM_SETCOLUMNWIDTH, 0, 300) GUICtrlSendMsg($ListView2, $LVM_SETCOLUMNWIDTH, 1, 288) $Button2 = GUICtrlCreateButton("Start Services", 464, 376, 129, 33) GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd ;#ce ;$Tab1 = GUICtrlCreateTab(16, 8, 601, 377) ;$TabSheet1 = GUICtrlCreateTabItem("Running Services") ;$ListView1 = GUICtrlCreateListView("Service Name", 24, 40, 582, 334) ;_GUICtrlListView_SetExtendedListViewStyle($ListView1, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_CHECKBOXES, $LVS_EX_GRIDLINES)) ;$ServiceName = "wuauserv" Local $Services = ObjGet("winmgmts:\\" & @ComputerName & "\root\cimv2") Local $ServicesList = $Services.ExecQuery("SELECT * FROM Win32_Service") If IsObj($ServicesList) then For $Services in $ServicesList ;If $Services.Name = $ServiceName Then ; if $Services.State = "Running" Then MsgBox(8192,"Hello", $Services.Name & $Services.State,0,$Form1) ;GUICtrlCreateListViewItem( $Services.Name & "|" & $Services.State , $ListView1) ;Run (@ComSpec & " /c " & 'net stop wuauserv') ; EndIf ;EndIf Next EndIf ;EndFunc But the msgbox does turn up when GUI runs. However, if I comment the GUI section, it works perfectly fine. Please help.
×
×
  • Create New...