65 posts in this topic
Syntax for embedding @username in tasklist command
I'm using this code:
#include <Constants.au3> Global $DOS, $Message = '' ;; added "= ''" for show only. $DOS = Run(@ComSpec & " /c tasklist /S server1 /U server1\admin /P password /FI " "USERNAME" & "eq" & @UserName /FI ""IMAGENAME eq notep*""", "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) ProcessWaitClose($DOS) $Message = StdoutRead($DOS) MsgBox(0, "Stdout Read:", $Message) But I can't get the syntax right. The tasklist command from the commandline goes like this and works:
tasklist /S server1 /U server1\admin /P password /FI "USERNAME eq user1" /FI "IMAGENAME eq notep*". So everything behind the FI parameter needs quotes. I'm using the @username macro to get the logged on user. But I just can't get the syntax right.
I'm getting the syntax error: "Statement cannot be just an expression."
Here's the piece of code where it occurs:
$Check = WinExists("MySQL Installer") If $Check <> "" Then WinClose("MySQL Installer") Else $Check = ControlGetHandle("", "&No", '[CLASS:Button; INSTANCE:2]') If $Check <> "" Then ControlClick("", "&No", '[CLASS:Button; INSTANCE:2]') Sleep(10000) WinClose("MySQL Installer") EndIf EndIf Anyone know why this error is occurring?
Mark/Highlight text in inputbox
I want to mark the content of an inputbox when you click on the text inside.
Excample: I have an inputbox which has the data "a". When I click inside the inputbox I want the "a" to be highlighted blue, so I can easily copy-paste it out.
GUICreate("",300,100) $Input1 = GUICtrlCreateInput("",10,10,50,30) $Input2 = GUICtrlCreateInput("a",100,10,50,30) GUISetState() While True Switch GUIGetMsg() Case -3 Exit EndSwitch WEnd I searched google and the forum and did not find anything.
I have a syntax error in an operation! Give me a tiny help, please!
Hello! I have a "syntax error" but I can't understand where is it. Can you help me with this?
There is two text files. I want to write three lines of the first file in each line of the second file. Then, if the first file has 600 lines, the second file should have 200 lines.
I hope I have explained well what I want.
#include <File.au3> Local $sFile1 $sFile1 = "File1.txt" Local $sFile2 $sFile2 = "File2.txt" Local $sThreeLinesIntoOne FileOpen($sFile1,0) FileOpen($sFile2,2) For $i In ( _FileCountLines($sFile1) / 3 ) For $a = ( ( $i - 1 ) * 3 ) + 1 ) To ( $i * 3 ) $sThreeLinesIntoOne = $sThreeLinesIntoOne & FileReadLine($sFile1, $a) Next FileWriteLine($sFile2, $sThreeLinesIntoOne) Next FileClose($sFile2) FileClose($sFile1) AutoIt returns:
Problem with a string (Very simple problem)
I can understand why this:
MsgBox(0, "", @AppDataDir & '\.minecraft\saves' & $myVar & '.ext') Is returning C:UsersDamonAppDataRoaming.minecraftsavesC:UsersDamonAppDataRoaming.minecraftsavesvariable here.ext
$myVar = "variable here"
I want C:UsersDamonAppDataRoaming.minecraftsavesvariable here.ext