
inthewayboy
Active Members-
Posts
34 -
Joined
-
Last visited
About inthewayboy
- Birthday 09/02/1980
Profile Information
-
Location
Atlanta, GA
-
WWW
http://suitifiable.tumblr.com
inthewayboy's Achievements

Seeker (1/7)
0
Reputation
-
Running a batch file in AutoIT
inthewayboy replied to jben's topic in AutoIt General Help and Support
Yeah, the .bat seems redundant at this point...using the Run() or RunWait() commands should yield positive results, and you could hide the GUI you are talking about by using the @SW_HIDE option for the command. It looks like MadBoy had the correct code on the first page to just run it natively in the script. That would be the direction I would take at least. I don't know about the Run32DLL, but I'm sure there is a way to execute that in AutoIt. -
GUI Newb Needs A Little Direction
inthewayboy replied to inthewayboy's topic in AutoIt GUI Help and Support
I was wondering what all that down there did, I'll review and beta some attempt at this and fill ya in. -
Hey guys, been using AutoIt for a few years now and never really got a chance to mess with the GUI stuff. But now I'm developing this simple reporting tools that I would like to open up with a GUI. The script is a basic Active Directory search and report script using dsquery.exe and dsget.exe. I know there is an adfunctions UDF but I'm trying to keep things as simple as possible without using third-party tools/scripts. Here is the script: #Region;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_outfile=beta.exe #EndRegion;**** Directives created by AutoIt3Wrapper_GUI **** #include<Array.au3> #include<File.au3> $root=ObjGet("LDAP://RootDSE") $domain=$root.Get("defaultNamingContext") $dsquery="bin\dsquery.exe" $dsget="bin\dsget.exe" $results="" $get="" $out="" $query=Run($dsquery&' user "OU=users,OU=jax,'&$domain&'" -limit 0 -scope subtree',"","", 2) Do $results&=StdOutRead($query) Until @error $array=StringSplit($results,@CRLF,1) _ArrayDelete($array,_ArrayMax($array)) For $item In $array $cmd=Run($dsget&" user "&$item&" -samid","","", 2) Do $get&=StdOutRead($cmd) Until @error Next $get=StringReplace($get,"samid","") $get=StringReplace($get,"dsget succeeded","") $get=StringStripWS($get,4) $get=StringReplace($get," ",@CRLF) $get=StringSplit($out,@CRLF,1) _ArrayDelete($out,_ArrayMax($out)) _ArrayDelete($out,1) _ArrayMaxIndex($out) $c=UBound($out) $get[0]=$c _ArraySort($out) _FileWriteFromArray("c:\test.txt",$out,1) And here is the basic GUI code I got from messing around with the Koda form designer: #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form=C:\Documents and Settings\Administrator\Desktop\scripts\gui.kxf $Query=GUICreate("Query",201,251,193,115) GUICtrlCreateCombo("",8,32,150,25) GUICtrlSetData(-1,"jax\users|jax\desktops|jax\desktops\ormond|jax\mobile|jax\servers|jax\groups\security|jax\groups\exchange") $File=GUICtrlCreateInput("File",8,168,98,21) $Browse=GUICtrlCreateButton("Browse",108,169,50,20,0) $Recursive=GUICtrlCreateCheckbox("Recursive",8,56,75,17) GUICtrlCreateCombo("",8,8,150,25) GUICtrlSetData(-1,"user|computer|group|ou") $Email=GUICtrlCreateCheckbox("email",88,72,75,25) $Name=GUICtrlCreateCheckbox("name",8,96,75,25) $User=GUICtrlCreateCheckbox("user",8,72,75,25) $Dn=GUICtrlCreateCheckbox("dn",8,120,75,25) $Tel=GUICtrlCreateCheckbox("tel",88,96,75,25) $Fax=GUICtrlCreateCheckbox("fax",88,120,75,25) $Desc=GUICtrlCreateCheckbox("desc",8,144,75,25) $Progress=GUICtrlCreateProgress(8,216,150,25) $Run=GUICtrlCreateButton("Run",107,192,50,20,0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg=GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Browse Case $Run EndSwitch WEnd I really just have no idea how I structure those two, how I make it so when I click a check box it adds that variable to the script, etc. I'm not looking for anyone to do it for just maybe give me some basic pointers to get me going. Also, if anyone would like to help streamline the script that would be good, I'm sure I'm going about somethings the wrong way so help a brother out! *The script won't work unless you have dsquery and dsget in a 'bin' folder parallel to the script. I do this because the workstation I run it from isn't Server 2003 so it doesn't have it by default. If you run this from a server you can edit those variables so it uses the server's copy located in system32. Also don't forget to check the syntax for the dsquery part, since my OU structure is bound to be different than yours.*
-
I'm trying to impliment exmerge in our exchange 2003 backup scheme, just for those few people who require extra data protection. I've currently gotten a basic script that calls exmerge.exe with the correct exmerge.ini and other supporting TXT files. However, this means I have to a unique files for each user. So what I was looking to do is have a single script that would not only perform the actual exmerge execution, but would also create the necessary files before that. Of course the real power of this would come in the form of a UDF, which I'm looking forward to testing over the weekend. But I have no clue as to how to attack the TXT files. My first thought was to establish a 'temp' working directory...the script would create the necessary files in that location, then run the exmerge process, and finish up with deleting the files and the 'temp' working directory. But I can't help but think there is an easier way. The text files are really simple...one tells exmerge which file store to work with, the other tells it which mail boxes to work with...in both cases it's just a single line of text, two if you include the 'header' that exmerge puts in the files when it creates them (Don't think they are required, but you never know). Any tips or suggestions on how to handle this? I'm really not used to interacting with files like this, so any help would be appreciated. and please, don't hesitate to give an example I've attached the files I'm currently using, edited to protect the innocent (And you can't upload .ini files?)...I would hope it's not too hard to follow. And I would be shocked if I was the only exchange admin on here...thanx in advance! databases.txt mailboxes.txt exmerge.au3 exmerge.ini.txt
-
Logon Scripts Via Group Policy
inthewayboy replied to inthewayboy's topic in AutoIt General Help and Support
After digging through the forums a little more I found this: http://www.autoitscript.com/forum/index.ph...0814&hl=gpo Looks like a guy had a script that was working fine until recently...it doesn't say if he updated his autoit but I wonder if the mechanics for the workingdir have changed recently. Seems like his issue is similar to mine, as well as the previous post. Anyone have any info regarding that? I' guess I could check the release notes, I might do that and see what I can find...or it could be totally unrelated, can't rule that out! -
Logon Scripts Via Group Policy
inthewayboy replied to inthewayboy's topic in AutoIt General Help and Support
I did try that and I think that was when I got the error I mention above... \\corp.lan\dfs\tech\scripts\bin\autoit3.exe script1.udf = could not find script at all \\corp.lan\dfs\tech\scripts\bin\autoit3.exe \\corp.lan\dfs\tech\scripts\bin\script1.au3 = found script but error at line 0 I'm not at work at the moment so I can't play, but I've got a whole weekend to figure this out. Maybe this is a better question, what would be the most reliable way to establish a workingdir for this kinda scenario. Would that be something I edit in the UDF's or the actual scripts? Hmmm -
I've got a fair amount of scripts that I've created over time that I want to keep in one central location. I have a windows based network, all servers runninng Win2003 SP2 R2. I use DFS to make sure all the servers have the scripts as well as centralizing the network paths to our shares. To give an example I have the scripts located at \\corp.lan\dfs\tech\scripts\bin, it also has a copy of the autoit executable. The scripts are not compiled, and I would like to keep them that way so editing isn't such a chore. My goal was to be able to use GPO's to run these based on security filtering, with the autoit executable being the script and the script being the parameters, like so: \\corp.lan\dfs\tech\scripts\bin\autoit.exe script.au3 Now if the user is logged on that works as expected, at least from cmd. However when I run it via GPO, as a user logon script, I get an error about reading line 0, saying it can't find the file. I'll get a more verbose copy of the error message shortly. I don't want to copy the script to the NETLOGON or SYSVOL shares, because then I'm gonna have multiple versions. And I would like to stay away from running compiled scripts for various reasons. Is anyone else doing something like this? I did find this forum post: http://www.autoitscript.com/forum/index.php?showtopic=28378 Which seems to have similar issues, but I don't how to impliment the solution of using @temp. I have several files that are setup as UDF's, which are included in other scripts which are what I'm trying to run via GPO. A more visual representation: \\corp.lan\dfs\tech\scripts\bin\ _UDF1.au3 _UDF2.au3 _UDF3.au3 autoit3.exe script1.au3 script2.au3 So the GPO is running autoit3.exe as the script, with script1.au3 as the parameter, which would #include _UDF1.au3. When I #include _UDF1.au3 I'm using the "" around the filename so it looks in the same dir as the script: #include "_UDF1.au3" I'll try and get some more info and scripts to provide some investigation, but seems like this is a pretty simple problem that I'm just not noticing. Again, if a user is logged in it works. I've also tried using mapped drives instead of UNC's and that doesn't fair any better. Thanx in advance!!!
-
WinSCP is great freeware SFTP app that supports commandline: http://winscp.net/eng/docs/commandline I figure that would do you right for uploading files via AutoIt!
-
Creating Config File For Script
inthewayboy replied to Chobyhy's topic in AutoIt General Help and Support
Sounds like I'm in the same boat too, using AutoIt as my entry into scripting/programming. Granted, I'm still a newb but I feel like I'm getting better all the time. I find the help file amazing, it explains most everything clearly and gives some nice examples too! And like it has been mentioned already the forums are the other great resource, no end to the genius on here. Between the two I haven't had much issues I could resolve. Back to the first part, something that I've been trying to impliment is creating custom UDF's that my other scripts hook up to via the #include command. -
Path Issue When Integrating AutoIt3
inthewayboy replied to inthewayboy's topic in AutoIt General Help and Support
Notepad2...and yeah, it looked like you needed to recomile it or something and that's when I gave up. Otherwise it's a sweet light-weight single-file replacement for Notepad. -
Path Issue When Integrating AutoIt3
inthewayboy replied to inthewayboy's topic in AutoIt General Help and Support
Well it's tricky, because I really love Notepad2, but I can't for the life of me figure out how to get it to recognize the AutoIt lexer. So I keep SciTE around for that, but I'm really starting to think about moving over to using just SciTE. And now that it doesn't look so complicated (Just the app and the api folder) I might do it. -
Path Issue When Integrating AutoIt3
inthewayboy replied to inthewayboy's topic in AutoIt General Help and Support
I seem to recall in my research into the inf portion that the %* is something special...something cryptic I'm sure. I'll see if I can't dig it up again, but it had to do with parameters, and the %* was kinda like a catch-all. And in the mean time the installation has finished and all is well. The final code is: HKCR,".au3","",0x00000000,"AutoIt3" HKCR,"AutoIt3","",0x00000000,"" HKCR,"AutoIt3","BrowserFlags",0x00010001,0x00000008 HKCR,"AutoIt3","EditFlags",0x00010001,0x00000000 HKCR,"AutoIt3\DefaultIcon","",0x00000000,"C:\WINDOWS\system32\AutoIt3.exe,0" HKCR,"AutoIt3\Shell","",0x00000000,"Open" HKCR,"AutoIt3\Shell\Open\Command","",0x00000000,"C:\WINDOWS\system32\AutoIt3.exe ""%1""" HKCR,"AutoIt3\Shell\Edit\Command","",0x00000000,"C:\WINDOWS\notepad.exe ""%1""" Of course now that there looks to be a portable SciTE with the new version I think I might try including that too. -
Path Issue When Integrating AutoIt3
inthewayboy replied to inthewayboy's topic in AutoIt General Help and Support
Also, since you are very well versed at both, would this scenario be any problem when it comes time to update AutoIt? From what I've seen it's pretty clean, to the point where I could just copy over the newer AutoIt3.exe and all is well. And I forgot to mention I do copy over the "Includes" folder, which ends up at C:\WINDOWS\system32\Includes. Again, when upgrade time comes just replace the files in there with the newer versions and that's all? -
Path Issue When Integrating AutoIt3
inthewayboy replied to inthewayboy's topic in AutoIt General Help and Support
Oh wow, it's been so long since a new release I never even checked that...sweet! I'll nab that and swap out the files! As far as what you are suggesting MHz I think we are talking about the same thing, but I am trying to do this from the source and not through a script, so would my adjusted code in the second post work? It looks like it's the same as yours (Converted) but you added a %* to it...what's that for? Is that a way to pass info to the script from a command arguement or something? -
Path Issue When Integrating AutoIt3
inthewayboy replied to inthewayboy's topic in AutoIt General Help and Support
Well it looks like enclosing the %1 with "" does the trick...I changed the registry on the machine I'm testing on and it works, so I'm going to try this code: HKCR,".au3","",0x00000000,"AutoIt3" HKCR,"AutoIt3","",0x00000000,"" HKCR,"AutoIt3","BrowserFlags",0x00010001,0x00000008 HKCR,"AutoIt3","EditFlags",0x00010001,0x00000000 HKCR,"AutoIt3\DefaultIcon","",0x00000000,"C:\WINDOWS\system32\AutoIt3.exe,0" HKCR,"AutoIt3\Shell","",0x00000000,"Open" HKCR,"AutoIt3\Shell\Open\Command","",0x00000000,"C:\WINDOWS\system32\AutoIt3.exe ""%1""" HKCR,"AutoIt3\Shell\Edit\Command","",0x00000000,"C:\WINDOWS\notepad.exe ""%1""" And then I'll see what happens...hehe, sometimes it's the simpliest things. I wonder though why the edit command works without the "" but the open command doesn't...any thoughts?