
GreatWest
Active Members-
Posts
40 -
Joined
-
Last visited
Everything posted by GreatWest
-
Problems executing VB Script after creating it.
GreatWest replied to GreatWest's topic in AutoIt General Help and Support
Like I posted to Hanns, it's not my package or process. I'm just trying to make a GUI to do all the work that they have me manually doing by jumping all over the place. It's no bother to them, they don't have to do anything but test their procedure. I have to run their process several times a day and it's a real joy. Thanks, Todd -
Problems executing VB Script after creating it.
GreatWest replied to GreatWest's topic in AutoIt General Help and Support
I'll take a look but the script is also used by another process out of my control and not of my design. Maybe I can work something out with the designer of the system. I'm pretty much just developing a GUI for their process because it's all text based through PowerShell, some VB scripts and going directly in AD with AD users and computers. Kind of a hodge podge of stuff I'm working with, trying to build a GUI to do all the work instead of having to bounce all over the place. Thanks, Todd -
Problems executing VB Script after creating it.
GreatWest replied to GreatWest's topic in AutoIt General Help and Support
Thanks for the hint. I went back and looked at the help file again to see if I could figure out exactly what you were referring to. I see how I used the filename incorrectly and that's why the file doesn't close. Thanks for the tip. I'll play around when I have some time and see if I can get the process to work the way I need it to. Todd -
I've written an AutoIt script that will create a vb script to create an OU in AD. The write works just fine creating the VB script. If I execute the VB script manually it works fine. If I try and execute the VB script with a Run command in AutoIt I get "The process cannot access the file because it is being used by another process". Following is the part of the code. $VB1ScriptFileName = $SiteNameNS & ".vbs" FileOpen($VB1ScriptFileName,2) FileWriteLine($VB1ScriptFileName, "Option Explicit") FileWriteLIne($VB1ScriptFileName, "Dim objRoot, objDomain, objOU") FileWriteLine($VB1ScriptFileName, "Dim strOUContainer") FileWriteLine($VB1ScriptFileName, "Dim intUser") FileWriteLine($VB1ScriptFileName, " ") FileWriteLine($VB1ScriptFileName, "' Section to bind to YOUR Active Directory.") FileWriteLine($VB1ScriptFileName, "Set objRoot = GetObject(" & """" & "[url="ldap://rootDSE"]LDAP://rootDSE[/url]" & """" & ")") FileWriteLine($VB1ScriptFileName, "objDomain = objRoot.Get(" & """" & "defaultNamingContext" & """" & ")") FileWriteLine($VB1ScriptFileName, "Set objDomain = GetObject(" & """" & "LDAP://" & """" & " & " & "" & "objDomain)") FileWriteLine($VB1ScriptFileName, " ") FileWriteLine($VB1ScriptFileName, "' Section to create the OU defined by strOUContainer") FileWriteLine($VB1ScriptFileName, "' Note .SetInfo") FileWriteLine($VB1ScriptFileName, "strOUContainer =" & """" & "OU=Inet" & $Corp & $SiteNameNS & ", OU=BusinessSharePoint, OU=Sharepoint, OU=Application Groups, OU=Security Groups, OU=Groups" & """" ) FileWriteLine($VB1ScriptFileName, " ") FileWriteLine($VB1ScriptFileName, "'On Error Resume next") FileWriteLine($VB1ScriptFileName, "Set objOU = objDomain.Create(" & """" & "organizationalUnit" & """" & ", strOUContainer)") FileWriteLine($VB1ScriptFileName, "objOU.Put " & """" & "Description" & """" & "," & """" & $OUSiteDescription & """") FileWriteLine($VB1ScriptFileName, "objOU.SetInfo") FileWriteLine($VB1ScriptFileName, " ") FileWriteLine($VB1ScriptFileName, "'WScript.Echo " & """" & "New OU created = " & """" & " & strOUContainer") FileWriteLine($VB1ScriptFileName, "WScript.quit") FileClose($VB1ScriptFileName) EndFunc Func VBExecute() Run('wscript.exe "C:\Users\jjones\Documents\FileAu~1\"' & $VB1ScriptFileName,'',@SW_HIDE) EndFunc I thought that since I closed the file that this should work. Instead, I have to exit the AutoIt script completely before the file is released and I can run it. Can I run the file after creating and closing it? What am I missing here? Thanks for any help you can provide. Todd
-
Need process user name info
GreatWest replied to GreatWest's topic in AutoIt General Help and Support
GREAT! I'll check that out as there is more information that we could use if we had access to it. Maybe that code will help get what we need. I really appreceate all the help. I really like the power of AutoIT and the help on this Forum is really great. I recently went through a college Java course and was a member of several Java forums. I must say that the help and lack of flaming here in the AutoIT forum is one of the reasons I enjoy this application so much. I was bombarded by flames by many of the Java developers, though a few were very helpful. I'm an old structured C/C++ programmer (haven't touched it in better than 10 years though) so I fell right into AutoIT without any problem, unlike Java. That visual programming method just doesn't work for me at all. I did pass my course with a "B" so I guess I didn't do too bad. The really funny part is that the instructor had never done any programming in a structured language before. She continually made comments about how visual programming could do this or that but the same could not be done in structured programming. I'm talking about simple things like functions and using modular design and such. I'll stick with AutoIT. To date it has done just about everything I've needed it to do. Now if someone can write up a library that will interface to MS SharePoint, then I'd be on cloud nine! Thanks again for all the help. I haven't work with AutoIT for about a year now so I'm just getting back into it, and enjoying its simple but powerful capabilities. I just need more practice so I can learn more about the code provided, how it works and all. Again, greatly apprceated. GW -
Need process user name info
GreatWest replied to GreatWest's topic in AutoIt General Help and Support
Got it working without too much trouble. Thanks! This is going to work great. Todd -
Need process user name info
GreatWest replied to GreatWest's topic in AutoIt General Help and Support
Thank you for providing the code. This is much more advanced than I am capable of right now but there's only one way to learn, right? I'll work with it and see if I can get it to provide the information I need. Thanks again. GW -
I've been asked to write script that will monitor specific processes and notify someone when one or more of the processes goes down. All the processes have the same name so I'm collecting the PID using ProcessGetStats and _ProcessGetName. This works great. Now that I'm able to monitor the processes I've been asked to add into the information provided the user name that the process was running under. Each process is running under its own special user name. In the task manager the processes look something like this: Image Name User Name CPU Mem Usage w3wp.exe ETPTL1 00 350,764 K w3wp.exe ETPTL3 00 415,264 K w3wp.exe ETPTL0 00 123,232 K w3wp.exe ETPTL5 00 239,293 K and so on, up to about 30 different user ID's to run each process. Does anyone know of a way to get the User Name information? This is the only way I can figure to identify which process died. Each User Name is tied to a specific site and will recycle and start back up with in about 60 seconds. So finding out which process and site went down is what I'm trying to record. Any ideas? Thanks, GW
-
Duh, GUICtrlSetData - Thanks!
-
I've done this in the past but just can't remember the way to do it. I have a routine that needs to update information in a window created by AutoIt. I can't even remember if I used a GUICreate to create the window. The information in the window is just text based. Can anyone point me to either someone else's post (which I haven't yet found) or to an AutoIt command that will create a window who's text I can update while the routine runs? Thanks - the brain is just not as sharp as it used to be. GW
-
I want to use some AutoIT scripts I've written to collect data from various sources. I would then like to have AutoIT place that data into a SharePoint list. I've looked a little at SOAP but I'm not sure if it would be the best way to get the data into the SharePoint list. Any suggestions would be appreceated. GW
-
Exactly, and the routine did pull the IP of the router assigned by Verizon, which is exactly what I'm needing. The simple routine posted works like a champ! GW
-
Dude! I love you! Well, not really but a great "THANK YOU". I've got to learn more about the Inet.au3 library. Thanks again, GW
-
GWDoes anyone know a method to pull a WAN IP address from say a LinkSys router without having to go to a website or pull up the routers web interface? I'm in need of a method to find the external IP address, not the internal of the home network. Any ideas would be appreciated. GW
-
How do I loop with a function inside?
GreatWest replied to GreatWest's topic in AutoIt General Help and Support
The database isn't wanting to accept the data "test.au3 (159) : ==> The requested action with this object has failed:" I've run into this before when trying to work with our database. You've given me a couple of ideas and new things to try - greatly appreceated. I'll keep trying and see if I can figure out what I'm doing wrong with the database. GW PS> Also greatly appreceate you leaving the old crap code in there just commenting it out and putting in how it should be done such as the $GUI_FOCUS instead of my silly tabs! keep doing that when you help others - it's great! -
How do I loop with a function inside?
GreatWest replied to GreatWest's topic in AutoIt General Help and Support
From my post with the code - "here's the code anyway with some parts blocked out for security reasons of course" I just missed the AID portion. GW -
How do I loop with a function inside?
GreatWest replied to GreatWest's topic in AutoIt General Help and Support
I'm not sure I understand what your saying here. Here's what I need - a gui that opens and places the cursor in the input box so all that has to be done is for the trigger on the scanner to be pressed. Once the text read from the scanner appears in the input box then I need a button pressed to submit the informaiton into the SQL database. Then the text in the input box should be cleared and I get to to do the entire processes again. I'm not sure how to put all the straight line code into fucntions. I'll have to look at the help file to see how to do that. Thanks for the suggestion. GW -
How do I loop with a function inside?
GreatWest replied to GreatWest's topic in AutoIt General Help and Support
Already done before you got around to posting your response, and you mention that there are misisng EndIf's - there are no IF statements so why would I need an EndIf, same with Wend. I have one While and it does have the closing Wend statement, and EndSelect I have it. GW -
How do I loop with a function inside?
GreatWest replied to GreatWest's topic in AutoIt General Help and Support
It compiles just fine using BetaCompile in SciTE and runs. As mentioned before I know the code is not clean but it does compile and run. GW -
How do I loop with a function inside?
GreatWest replied to GreatWest's topic in AutoIt General Help and Support
I doubt it's a syntax error because I'm just adding a Do/Until but here's the code anyway with some parts blocked out for security reasons of course. I know it looks like crap so no need to tell me that - it works for the most part and right now I don't have to much time for cleanup. I just don't know why I can't loop a function. ; ---------------------------------------------------------------------------------- ; AMS Check In ; ; Script Function: This script allows IT Techs to check in computers using either ; a keyboard wedge scanner or manually by typing in the computers service tag. ; ----------------------------------------------------------------------------------- #Include <process.au3> #Include <Date.au3> #include<GUIConstants.au3> GUICreate("Check In", 320,260) GUISetFont(12,600,1,"Arial") GUICtrlCreateLabel("Quick Computer Check-In",55,10) GUICtrlCreateLabel("Asset Status ",100,50) GUISetState(@SW_SHOW) ; first number is horizontal, second number is vertical GUISetFont(12,100,1,"Arial") $AssetTag = GUICtrlCreateCombo("",80,80,170) GUICtrlSetData(-1,"Ready to Deploy|Down|Idle","Ready to Deploy") $AST = GUICtrlRead($AssetTag) $AssetStatus = $AST GUISetFont(12,600,1,"Arial") GUICtrlCreateLabel("Scan Service Tag ",90,130) ; first number is horizontal, second number is vertical GUISetFont(12,100,1,"Arial") $SERVTAG = GUICtrlCreateInput("",80,160,170) Send("{TAB}{TAB}") $AssetCurrency = "" $AssetID = "" $Category = "Hardware" $Manufacturer = "" $Item = "" $HowUsed = "" $Region = "Americas - U.S.A. - Texas" $Site = "Dallas" $AssetLoc = "Building 2" $TITagNum = "" $EndUserEmpID = "Inventory" $ReportingMgrAID = "" $SystemID = "CN0XInventory" $MaintVenName = "" $ReceivedDate = "" $InstallDate = "" $DisposalDate = "" $OwnerCostCenter = "" $PRNumber = "" $PONumber = "" $OwnershipType = "Expense" $SupportGroup = "IT" $LoanerReturnDate = "" $UserDefined1 = "" $UserDefined2 = "" $DATERUN = @MON & "/" & @MDAY & "/" & @YEAR $UserDefined3 = $DATERUN $btn = GUICtrlCreateButton ("Submit", 135, 210, 60, 20) GUISetState () $msg = 0 While $msg <> $GUI_EVENT_CLOSE $msg = GUIGetMsg() Select Case $msg = $btn exitloop EndSelect Wend $ST = GUICtrlRead($SERVTAG) $SerialNumber = $ST $TITagNum = "ES" & $SerialNumber $SQLQuery = "INSERT INTO Table (" _ & "AssetCurrency," _ & "AssetID," _ & "AssetStatus," _ & "Category," _ & "Manufacturer," _ & "Item," _ & "HowUsed," _ & "Region," _ & "Site," _ & "AssetLoc," _ & "TITagNum," _ & "EndUserEmpID," _ & "ReportingMgr_ID," _ & "SerialNumber," _ & "SystemID," _ & "MaintVenName," _ & "ReceivedDate," _ & "InstallDate," _ & "DisposalDate," _ & "OwnerCostCenter," _ & "PRNumber," _ & "PONumber," _ & "OwnershipType," _ & "SupportGroup," _ & "LoanerReturnDate," _ & "UserDefined1," _ & "UserDefined2," _ & "UserDefined3" _ & ") VALUES (" _ & "'" & $AssetCurrency & "'" & "," _ & "'" & $AssetID & "'" & "," _ & "'" & $AssetStatus & "'" & "," _ & "'" & $Category & "'" & "," _ & "'" & $Manufacturer & "'" & "," _ & "'" & $Item & "'" & "," _ & "'" & $HowUsed & "'" & "," _ & "'" & $Region & "'" & "," _ & "'" & $Site & "'" & "," _ & "'" & $AssetLoc & "'" & "," _ & "'" & $TITagNum & "'" & "," _ & "'" & $EndUserEmpID & "'" & "," _ & "'" & $ReportingMgr_ID & "'" & "," _ & "'" & $SerialNumber & "'" & "," _ & "'" & $SystemID & "'" & "," _ & "'" & $MaintVenName & "'" & "," _ & "'" & $ReceivedDate & "'" & "," _ & "'" & $InstallDate & "'" & "," _ & "'" & $DisposalDate & "'" & "," _ & "'" & $OwnerCostCenter & "'" & "," _ & "'" & $PRNumber & "'" & "," _ & "'" & $PONumber & "'" & "," _ & "'" & $OwnershipType & "'" & "," _ & "'" & $SupportGroup & "'" & "," _ & "'" & $LoanerReturnDate & "'" & "," _ & "'" & $UserDefined1 & "'" & "," _ & "'" & $UserDefined2 & "'" & "," _ & "'" & $UserDefined3 & "'" _ & ")" $DSN = "Provider=SQLOLEDB;SERVER=********;DATABASE=*****;UID=*****;PWD=******" ExecuteQuery($DSN, $SQLQuery) Func ExecuteQuery ($DSN,$SQLQuery) $adoSQL = $SQLQuery $adoCon = ObjCreate("ADODB.Connection") $adoCon.Open ($DSN) $adoCon.Execute($adoSQL) $adoCon.Close EndFunc I just need it to loop back to the top and start over again after putting the data into the SQL database. Thanks for any suggestions. GW -
I have a routine that collects information from a hand held scanner. This is a simple GUICreate with a CreateInput box. The scanner is a keyboard wedge type so once an item has been scanned the alpha numerics show up in the input box just as if they were typed on a keyboard. I then use a simple While/Wend to check to see if the Submit button has been pressed. Next the data is placed into the SQL database with a Func/EndFunc routine. Then the script exits. No issues, the data is scanned, variables set, and data goes into my SQL table without issue. I figured I would just use a simple Do/Until to loop the routine but it doesn't work. I can't even run the script once I put the Do/Until in. So the present script goes something like this - Create/Open GUI. Scan the bar code into the input box. Press the Submit button (using a While/Wend) Put the variable information into SQL with a Func/EndFunc Exit the script If I put the Do up near the start of the script with the Until at the bottom. I get the following error - S:\AIS.au3(145,2) : ERROR: missing Until <expr>. Func ^ S:\AIS.au3(15,1) : REF: missing Until <expr>. Do ^ S:\AIS.au3(153,1) : ERROR: syntax error Until ^ S:\AIS.au3 - 2 error(s), 0 warning(s) Now if I leave the Do/Until there and just comment out the SQL function the script runs fine, repeats itself until I kill the script. $DSN = "Provider=SQLOLEDB;SERVER=XXXXXXX;DATABASE=XXXXXX;UID=XXXXXX;PWD=XXXXXX" ExecuteQuery($DSN, $SQLQuery) Func ExecuteQuery ($DSN,$SQLQuery) $adoSQL = $SQLQuery $adoCon = ObjCreate("ADODB.Connection") $adoCon.Open ($DSN) $adoCon.Execute($adoSQL) $adoCon.Close EndFunc So pretty much if I take the entire function statement above out of the script the script runs just fine and loops just fine. If I put the function back in, I get the error about the Do/Until loop. GW
-
Error: Unable to execute the external program
GreatWest replied to GreatWest's topic in AutoIt General Help and Support
Thanks lod3n - much cleaner and I need to clean up my code one of these days when I have time. For now it's working and I don't touch things that work! GW -
Error: Unable to execute the external program
GreatWest replied to GreatWest's topic in AutoIt General Help and Support
Actually yes it will work both ways. Remember I mentioned this has been running for almost two years this way without error. I'm still not sure why the error just magically showed up but big_daddy pointed me in the right direction. Thanks for responding though. GW -
Error: Unable to execute the external program
GreatWest replied to GreatWest's topic in AutoIt General Help and Support
You hit it on the head. I never had to put the working directory in before so I didn't even try that. The really strange part is that the area where the error was occuring I never touched. Really strange but I'm not questioning it now that it's working. Thanks for the pointer! GW -
Error: Unable to execute the external program
GreatWest replied to GreatWest's topic in AutoIt General Help and Support
Simply because I'm trying other options. The same issue happens with Run or RunWait. GW