-
Posts
447 -
Joined
-
Last visited
Content Type
Forums
Downloads
Forum Articles
Events
Everything posted by EndFunc
-
$STDOUT_CHILD is not producing any results
EndFunc replied to EndFunc's topic in AutoIt General Help and Support
Ah, I'm stupid for not noticing that. The script wasn't giving an error at all it was running through and not outputting anything. The problem was the the msgbox. Instead of giving me an error because I didn't include MsgBoxConstants.au3 it just seem to ignore it so the script just ran and did nothing. Normally it should say their is a variable not defined. Thanks for clarity and 2nd set of eyes. -
$STDOUT_CHILD is not producing any results
EndFunc posted a topic in AutoIt General Help and Support
Whenever I try to run this simple command it does not work with the constants at the end. If I remove the $STDERR_CHILD and $STDOUT_CHILD, the command works but of course I can't capture the text. I've tried many ways. I have the autoconstants include declared also. I looked at other topics in the forum and many are very old but didn't seem to be this scenario. AutoIt ver 3.3.12 Local $get = Run(@ComSpec & " /c ipconfig","",@SW_SHOW,$STDERR_CHILD + $STDOUT_CHILD) While 1 $sOutput = StdoutRead($get) If @error Then ExitLoop EndIf MsgBox($MB_SYSTEMMODAL, "Stdout Read:", $sOutput) WEnd -
Script run msi in 64bit from netshare
EndFunc replied to Pakserrion's topic in AutoIt General Help and Support
Are you using the correct package name and the full path to the msi file? Also you probably need to specify the working directory as well. The help file for RunAs suggests that it is needed. -
Active Directory UDF - Help & Support (III)
EndFunc replied to water's topic in AutoIt General Help and Support
Did you actually look at the UDF first? _AD_AddUserToGroup- 883 replies
-
- active directory
- ad
-
(and 2 more)
Tagged with:
-
FileWriteToLine help is not working for me. v3.3.10.0
EndFunc replied to meows's topic in AutoIt General Help and Support
Note that the function will not work if there is no line there already. Your script will create the file if it doesn't exist. So that means the file is empty. There are no lines so it sets @error to 1 for the first line you try to write and so forth. _FileWriteToFile seems to imply there is a line there already. It's not working the way you might think it should. You might need to use FileWriteLine. You can try this. If Not _FileCreate(@ScriptDir & "\test.txt") Then MsgBox(48, "Error", " Error Creating test txt. error:" & @error) FileWriteLine(@ScriptDir & "\test.txt", "my replacement for line 1") FileWriteLine(@ScriptDir & "\test.txt", "my replacement for line 2") FileWriteLine(@ScriptDir & "\test.txt", "my replacement for line 3") EndIf FYI I would use backslashes in paths. Just standard for windows. -
Active Directory UDF - Help & Support (III)
EndFunc replied to water's topic in AutoIt General Help and Support
There is a list domain controllers function in the AD UDF if that is useful to you. However you shouldn't need to manually enter the main domain in an input box. Nearly everything can be automated. You can use the macro to get the domain name and use it to join the domain. @LogonDomain msgbox(64, "domain", @LogonDomain)- 883 replies
-
- active directory
- ad
-
(and 2 more)
Tagged with:
-
Run AutoIt Remotely - Nothing seems to work
EndFunc replied to EndFunc's topic in AutoIt General Help and Support
I was able to get farther now and I had to change RunWait to ShellExecuteWait to get part of the script working. But the problem it seems to having now is spaces in the UNC path. Local $hSearch = FileFindFirstFile("\\srv01\software\Server Software\scripts\latest_tsm\*.exe") It fails on this when compiled and called remotely. It works when not compiled and ran from the server. -
pause the program until click the msgbox
EndFunc replied to tonysing's topic in AutoIt General Help and Support
I must have missed something too because the msgbox is typically blocking execution of the rest of the script until it's dimissed. You can try this below. This will install the script if you press OK or wait for 15 seconds. If you hit Cancel it quits. Dim $iMsgBoxAnswer $iMsgBoxAnswer = MsgBox(8513,"Software Installation","Voltage Encryption Client for Outlook will be installed on your computer. Please close Microsoft Outlook, Adobe Reader and IE and click OK to start the installation.",15) Select Case $iMsgBoxAnswer = 1 ;OK _Install() Case $iMsgBoxAnswer = 2 ;Cancel Exit Case $iMsgBoxAnswer = -1 ;Timeout _Install() EndSelect Func _Install() ;Your script stuff in here EndFunc -
Run AutoIt Remotely - Nothing seems to work
EndFunc replied to EndFunc's topic in AutoIt General Help and Support
Yeah I'll see what I can do. I can't use openssh with this server but I'll keep testing and put some debug code in. I don't get it either. I'll also test with my account again after putting some debug code in. -
I never said you installed anything. I was just giving you suggestions of what to try and look for. If it doesn't see the class, then it either needs the library or probably just needs to be enabled. Here http://bit.ly/1wsx2LI
-
Run AutoIt Remotely - Nothing seems to work
EndFunc replied to EndFunc's topic in AutoIt General Help and Support
Win2012. Hmm, It appears to be running when using system account, I have been wachting task manager closer, but it starts and goes away, so something is erroring out. Event logs don't show anything useful that I can see. -
How old is your version of PHP? You might try using PEAR to install SOAP, it not loaded. Also if you're using the PHP CLI, which it looks like, it might not have SOAP loaded as it uses a different PHP.ini file than the regular PHP code uses.
-
I've been trying to execute an AutoIT script on a remote server and not having any luck. I don't want to do the old create a sched task to have it run. I've tried calling it from powershell (Invoke-Command), WinRS and PSexec. They run but the script never starts. No error messages. PSexec gives this result within a few seconds. Which means it ran. d:myautoit.exe exited on servername with error code 0 I'm not sure why it won't run. I even added RequireAdmin to the code to see if thats the issue. Ran PSexec with the -i and -s options and even passed my creds with no luck. Why won't this script run? Works fine if I double click it. The autoit exe does a package install by calling an msi and does some configurations after awhile so it's not something that is done fast. I should see it in the task manager for a while just like when I run it manually. I'm hoping someone has some suggestions.
-
Command line with spaces in the path
EndFunc replied to EndFunc's topic in AutoIt General Help and Support
Nevermind I was able to get it to work using the "Working directory" parameter of runwait. $iSched = RunWait(@ComSpec & ' /k ' & 'dsmcutil.exe inst scheduler /name:"ADSM Scheduler" /node:' & @ComputerName & ' /clientdir:"D:\Program Files\Tivoli\TSM\baclient" /optfile:"D:\program files\tivoli\tsm\baclient\dsm.opt" /password:' & @ComputerName & ' /validate:yes /autostart:yes /startnow:yes', "D:\program files\tivoli\tsm\baclient", @SW_SHOW) -
I'm pulling my hair out. This is one of the most problematic things for me is escaping commandline stuff with autoit. Anyway, I keep trying to run this command for back up scheduling and it doesn't recognize my quotes. Unfortunately the path has a space. What exactly am I doing wrong? $iSched = RunWait(@ComSpec & ' /k ' & '"D:\program files\tivoli\tsm\baclient\dsmcutil" inst scheduler /name:"ADSM Scheduler" /node:' & @ComputerName & ' /clientdir:"D:\Program Files\Tivoli\TSM\baclient" /optfile:"D:\program files\tivoli\tsm\baclient\dsm.opt" /password:' & @ComputerName & ' /validate:yes /autostart:yes /startnow:yes', "", @SW_SHOW) I get this error.
-
Can we save the window page using autoit?
EndFunc replied to madhuri's topic in AutoIt General Help and Support
Not sure what it is you're doing but this is a simple version. WinActivate("AutoItScript - AutoItScript Website - Mozilla Firefox") Send("!f") Sleep(500) Send("a") WinWaitActive("Save As") Sleep(1000) Send("!s") -
Can we save the window page using autoit?
EndFunc replied to madhuri's topic in AutoIt General Help and Support
I would say many windows and menus are able to be automated. Have you tried anything yet? Depending on how you want to do it, you could look at Controlclick(), ControlSend() in the helpfile. -
StdOutRead broken or what am i doing wrong
EndFunc replied to EndFunc's topic in AutoIt General Help and Support
Never really thought to try it that way. Usually just works. Cool good to know. -
StdOutRead broken or what am i doing wrong
EndFunc replied to EndFunc's topic in AutoIt General Help and Support
Hmm, now this works as I would think it should putting the extra loop. That's a cool trick to use. -
StdOutRead broken or what am i doing wrong
EndFunc replied to EndFunc's topic in AutoIt General Help and Support
@FireFox, ok thanks. It's just weird because this is the first time I've ran into a problem using that before. It's always worked the way I've used it in the past. I guess I've been lucky not sure. -
Clicking a button on a program console screen
EndFunc replied to ckboii89's topic in AutoIt General Help and Support
Would this not be game automation? -
StdOutRead broken or what am i doing wrong
EndFunc replied to EndFunc's topic in AutoIt General Help and Support
I understand what you're saying to do, however even when I do that, for some reason if I use that conditional inside the loop, it will return part of the string in string I "Searched" for instead of the full string that was searched. So it doesn't seem to work the way I logically would expect it or like another language would handle the string. I'm trying to understand why AutoIt works this way. example: If I want to know if a VAR contains a string I check it with a stringinstr(). However with AutoIt when I'm in the loop to capture the stdout, and I msgbox or echo the variable during each iteration, the first msgbox is empty and the 2nd returns the full string I'm looking for. Basically going line by line which is how I thought it worked and has in the past without using &= to add the var together, this example directly from the help. Which is what the below code does, so far so good. Local $foo = Run(@ComSpec & " /c powercfg -getactivescheme", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) Local $line While 1 $line = StdoutRead($foo) If @error Then ExitLoop MsgBox(0,0,$line) WEnd So now using the code above the msgbox showed me on the 2nd iteration the value of $line is "Power Scheme GUID: 381b4222-f694-41f0-9685-ff5bb260df2e (Balanced)" Great, it shows the full line. Ok I now want to introduce a conditional so that it will skip the first time which $line has no value in the first iteration and do this below Func _GUID() Local $foo = Run(@ComSpec & " /c powercfg -getactivescheme", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) Local $line $k = 0 While 1 $line = StdoutRead($foo) If @error Then ExitLoop If StringInStr($line, "GUID") Then return $line ;or msgbox the result to see value EndIf WEnd EndFunc But then it returns the value of $line = "Power Scheme GUID:" . Whoa, what happened to the rest of the line with the actual GUID. It gets cut off. So it will return an incomplete result. This is where I do understand why it works that way. Without the StringinStr condition, the 2nd iteration gives the full string, with the the condition it only returns a partial string on the 2nd iteration. So then my code is broken because it will stop once it finds GUID. Just because I introduce a condition the value of $line should not change on the 2nd iteration but it does. Now doing as suggested using &= and adjusting my code I get the full string, but logically I don't see why the original way I tried to do it won't work. This works below, BUT, I've never really had to use &= before reading stdout and I don't always want to. If the result is a lot of text I only what to capture the line that has the string in it, because more than likely I'm going to manipulate it. I've made plenty of scripts in the past 9 years using AutoIt and have never had to do it this way. So that is why I'm so confused. Func _GUID() Local $foo = Run(@ComSpec & " /c powercfg -getactivescheme", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) Local $line While 1 $line &= StdoutRead($foo) If @error Then ExitLoop WEnd MsgBox(0,0, $line) ;yep full string I need is there $line = StringStripWS($line, 8) $G = _StringBetween($line, ":", "(") MsgBox(0,0, $G[0]) EndFunc So I still think something is wrong. -
StdOutRead broken or what am i doing wrong
EndFunc posted a topic in AutoIt General Help and Support
I'm not unfamiliar to Autoit obviously but this is baffling me. Is this a bug in StdOutRead? This is a very simple way to see the GUID of your power settings on a laptop but its not working as long as it's inside an IF conditional. Local $foo = Run(@ComSpec & " /c powercfg -getactivescheme", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) Local $line While 1 $line = StdoutRead($foo) If @error Then ExitLoop If StringInStr($line, "GUID") Then MsgBox(0, "STDOUT read:", $line) EndIf WEnd The message should show: Power Scheme GUID: 381b4222-f694-41f0-9685-ff5bb260df2e (Balanced) But it's only coming back with a partial string Power Scheme GUID: If you remove the condition IF statement and just leave the msgbox line by itself on the 2nd iteration it will show the entire string. Now if you do this code below, you can see it going through 2 iterations, which it should, so I use another msgbox to show that. If you also put another msgbox line out side of that then you get 2 iterations and 3 msgboxes(in the real script I won't be using msgbox, it will be a variable.) Local $foo = Run(@ComSpec & " /c powercfg -getactivescheme", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) Local $line While 1 $line = StdoutRead($foo) If @error Then ExitLoop If StringInStr($line, "GUID") Then MsgBox(0, "STDOUT read:", $line) EndIf MsgBox(0, "STDOUT read:", $line) WEnd I use the conditional so I can capture that string on the iteration that contains GUID. But it doesn't work as long as its in side the IF statement and only shows the partial string. Anyone have any ideas why it's acting so weird? -
you will have to do TWO different sends one to the Username field and one to the password field. It would be tricky because you'll also have to use send to do a TAB and things like that. I would suggest using ControlSend() for more accuracy and you can direct it to the control of your login box. You will still need to call it twice though for each input. Take a look at the help file also. e.g. ControlSend("window title", "", "contorl_id1", $username) Sleep(300) ControlSend("window title", "", "contorl_id2", $password)