Jump to content

slybry70

Active Members
  • Posts

    27
  • Joined

  • Last visited

Everything posted by slybry70

  1. I have tried a couple of the Services UDF out there and they are old and not updated. Is there any UDF's that anyone is using that are still working that work with remote or local services on current OS models? Tried a couple UDF's and they were made over 10 years ago and aren't working correctly. Thank you.
  2. Thank you for the constructive reply first of all. I was not aware of the ctrl F5 with the line added to the script would show in verbose errors. It helps alot in the long run. I am new to scripting in general and right now just barely limping along. Purchased a book online but no courses on Autoit are out there and almost no education book wise. I figured it would be obvious I am not a scripting expert let alone an AutoIT expert. I included my whole script in the posting because that is what normally is requested by those that help out on the forums. In the past I have gotten some nice and informative help on these forums so I hope that in the future that continues. I am grateful for your look at the script and will go through it again with this new error information. Thank you for taking the time to look at it TheXMan!
  3. Looks like since no one knows if excel UDF arrays and listview are compatible I will stick with the excel UDF arraydisplay and try to work with that view......
  4. Also already looked at the dimension with Local $iDimension = UBound($aResult, $UBOUND_DIMENSIONS). Line 211.
  5. I am aware of how to make it display using arraydisplay. I did successfully get it working but I do not like the GUI of arraydisplay or working with it. Listview seems better and other posters on the forums said they recommend using listview and not Excel UDF. So pulling the array with $aResult = _Excel_RangeRead($oWorkbook, Default, $oWorkbook.ActiveSheet.Usedrange.Columns("A:A"), 2) You cannot enter it into a listview?
  6. With this change " For $iIncrement = 0 to $aMax -1 $aResult[$iIncrement] = "PC:" & $iIncrement ; This is not working. Getting a incorrect subscript or subscript dimension range exceeded. Next " I get a GUILISTVIEW error. I got the $aResult from a Excel UDF command that created the array. Can you use that information in a listview without converting it into another array?
  7. I made that change: For $iIncrement = 0 to $aMax - 1 Its still showing that there is an error with the next line. 232-$aResult[$iIncrement][0] = "PC:" & $iIncrement . Showed no change in the error. For a single dimension array shouldn't there be just one [ ]?
  8. Hello all, I am having complications with arrays. I am new to arrays and still trying to wrap my head around them. Couple of notes about the script I am creating. This script is used to input either a single computer name or multiple computer names and remove information pertaining to those computer names in a certain application. The section of the program for removing a single computer names information is working decent. The section of the code that pertains to removing the information for multiple PC's is not working currently. Line that errors out is 232-Getting Incorrect subscript or subscript dimension range exceeded In the script I have the code open excel. Then input a list of computer names in the first column. Lines 210 to 213 show me that it is indeed pulling a single dimension array and I can even display it using array display. I think I am originally pulling the information using the Excel UDF commands and wondering if the error is because I am trying to use that array it created to display in a listview? Thank you for any input 🙂 ComputerDecommLV.au3
  9. Thank you. I have used Excel UDF but thank you for the information on GUICtrlCreateListView. Looks like it could do mostly what I had in mind 🙂 Thank you for your time!
  10. As I stated earlier what I would like to do in the function ExcelEntriesFunc() is this. I would like to copy from excel or text file and into a GUI window that will take the input and create the array, Show a GUI with that list and go down the list showing as they are removed until you reach the end. This has been problematic. I cannot find any info online about copying a group of strings then pasting into a Autoit Window and having it create the array with that input. Does this sound familiar with anyone? I am sure that I could get it working if I copied all the computer names into a excel file then read all those names from that excel file and show them into a GUI and go through that list while removing each but this would not be as efficient as copying all the computer names into a autoit Window which would be faster and more efficient. Not sure how good I am describing what I am needing.....
  11. The script is working for a single pc name to remove from the specific application. Now working on the function at the bottom that is listed as ExcelEntriesFunc()
  12. ; Computer LWS Decommission Script #include <GUIConstantsEx.au3> #include <GuiListBox.au3> #include <Constants.au3> #include <MsgBoxConstants.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <GUIConstants.au3> #include <Excel.au3> #include <File.au3> #include <Misc.au3> #include <FileConstants.au3> #include <Array.au3> #include <ProgressConstants.au3> #include <ColorConstants.au3> #include <WinApi.au3> #include <IE.au3> Global $EnterPCNames, $ReadExcelNames, $ManuallyChecked, $ExcelReadChecked Opt("TrayAutoPause", 0) Local $iAnswer = MsgBox(BitOR($MB_YESNO, $MB_SYSTEMMODAL, $MB_TOPMOST), "SLHS Computer Removal", "This is the SLHS Computer Removal script Hit Yes to Continue. Hit No if you do not wish to run this script.") MsgBox(BitOR($MB_OK, $MB_SYSTEMMODAL, $MB_TOPMOST), "Make sure Text is set to LWS main Menu.", "Hit Ok once Text is set to LWS and its left on the main Menu.") ;***************************************************************************************************** ;----------------Map T drive if its not Mapped------------------------------ Might not need this and can take out later on. If $iAnswer = 7 Then MsgBox($MB_SYSTEMMODAL, "AutoIt", "Exiting script.") Exit EndIf DriveMapGet("T:") If @error = 1 Then ;msgbox(0,"result", "NOT MAPPED") DriveMapAdd("T:", "\\fs1cle\tech") Else ;msgbox(0,"result", "MAPPED") EndIf ;***************************************************************************************************** ; Initial GUI Setup Global $aTaskbarinit = WinGetPos("[CLASS:Shell_TrayWnd]", "") $Window = GUICreate("Choose the method of entering the PC names:", 440, 100, @DesktopWidth, @DesktopHeight) WinSetOnTop("Choose the method of entering the PC names:", "", 1) Global $aWinInitGui = WinGetPos($Window) $EnterPCNames = GUICtrlCreateCheckbox("Enter PC Names in Manually.", 8, 8, 160, 17) $ReadExcelNames = GUICtrlCreateCheckbox("Read all names from an Excel File.", 8, 32, 180, 17) ;41,17 Global $GUIContinueButton = GUICtrlCreateButton("Continue", 8, 65, 75, 25, $WS_GROUP) ; Move the Initial GUI to the bottom right WinMove($Window, "", @DesktopWidth - $aWinInitGui[2] - 4, @DesktopHeight - $aWinInitGui[3] - $aTaskbarinit[3] - 4) GUISetState(@SW_SHOW) Sleep(2000) ;---------------------------------------------------------------------------------------------------------------------------- ;-------------------Is checked for each box0------------ $ManuallyChecked = GUICtrlRead($EnterPCNames) $ExcelReadChecked = GUICtrlRead($ReadExcelNames) ;Global $CurrUser = StringMid("Currently logged in User: " & _GetConsoleUser(), 31, 6) ; Find out which ones were checked and pull out the name of the Printer. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $GUIContinueButton If GUICtrlRead($EnterPCNames) = $GUI_CHECKED Then ;GUICtrlSetData($ManuallyChecked, 'Checked') ManualEntryFunc() Sleep(2000) Else GUICtrlSetData($EnterPCNames, 'Unchecked') EndIf If GUICtrlRead($ReadExcelNames) = $GUI_CHECKED Then ;GUICtrlSetData($EpicChecked, 'Checked') ExcelEntriesFunc() Sleep(2000) Else GUICtrlSetData($ReadExcelNames, 'Unchecked') EndIf ExitLoop EndSwitch WEnd GUISetState(@SW_ENABLE) GUIDelete($Window) Func ManualEntryFunc() Local $PCname, $PCNameLabel, $PCNameInput, $PCNameView, $GUIContinueButton, $iAnswer, $RNDM, $AVNumber ; Remove the initial Window. GUISetState(@SW_ENABLE) GUIDelete($Window) ;Create the Window to enter the single computer name------------------------------------------------ ; Initial GUI Setup Global $aTaskbarinit = WinGetPos("[CLASS:Shell_TrayWnd]", "") $SinglePCGUI = GUICreate("PC Name to Decommission LWS", 440, 100, @DesktopWidth, @DesktopHeight) WinSetOnTop("Please enter the Computer name to Decommission:", "", 1) Global $aWinInitGui = WinGetPos($SinglePCGUI) ;$EnterPCNames = GUICtrlCreateCheckbox("Enter PC Names in Manually.", 8, 8, 160,17) Local $PCNameLabel = GUICtrlCreateLabel("Enter PC name being removed: ", 8, 15, 165, 20) Local $PCNameInput = GUICtrlCreateInput("", 175, 15, 100, 20) ; 80,20 Local $GUIContinueButton = GUICtrlCreateButton("Continue", 8, 65, 75, 25, $WS_GROUP) ; Move the Initial GUI to the bottom right WinMove($SinglePCGUI, "", @DesktopWidth - $aWinInitGui[2] - 4, @DesktopHeight - $aWinInitGui[3] - $aTaskbarinit[3] - 4) GUISetState(@SW_SHOW) Sleep(2000) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $GUIContinueButton If GUICtrlRead($PCNameInput) = "" Then Local $PCNameLabel = GUICtrlCreateLabel("No computer name entered. ", 8, 35, 165, 20) Sleep(5000) ManualEntryFunc() Else $PCNameView = GUICtrlRead($PCNameInput) WinActivate("You are connected to Epic ""PROD"" Environment", "") ; Activate the Chronicles window Sleep(2000) WinSetState("You are connected to Epic ""PROD"" Environment", "", @SW_ENABLE) Send("{ENTER}" & "{ENTER}" & "11" & "{ENTER}" & "LWS" & "{ENTER}" & "1") Sleep(2000) Send("{ENTER}" & "1" & "{ENTER}" & "1" & "{ENTER}") ; Should be at the Workstation LWS prompt at this time. Now Remove all Entries. ;------------------------------------------------------------------------------------------------------------------------------------- Sleep(2000) Send($PCNameView & "{ENTER}") ;------------Find out if the computer name has an LWS or not and remove it if it does. Local $iAnswer = MsgBox(BitOR($MB_YESNO, $MB_SYSTEMMODAL, $MB_TOPMOST), "LWS Exists?", "Does this computer have an lws. (Yes/No)") If $iAnswer = 7 Then ; No Answer MsgBox($MB_SYSTEMMODAL, "PC Decommission", "There is no LWS for this PC name.") Sleep(5000) Exit Else ;Yes Answer Send("{home down}" & "{F9}" & sleep(1000) & "{home up}" & "i") Send("{ENTER}" & "52216" & "{ENTER}" & "100000" & "{ENTER}") ;Set 100000-SLHS COMBINATION FDI sleep(2000) Send("{PGUP 7}" & "{ENTER}" & "{F1}") ;Set Exam room workstation: sleep(2000) Send("{PGUP 2}" & "{F1}" & "{ENTER 2}" & "{F1 20}") ;Set Default OTG to Empty and same with additional departments sleep(2000) Send("{PGUP 5}" & "{F1 5}" & "{ENTER 2}" & "{F1 60}") ; Remove all print groups and classifications. Sleep(4000) Send("{PGUP 10}" & "{F1}" & "{ENTER}" & "{DOWN 2}" & "{TAB}" & "No") ; Remove setting for epic hyperspace timeout sleep(4000) Send("{PGUP}" & "{F1}" & "{ENTER}" & "{F1}" & "{ENTER}") ;Remove Department and Profile Department sleep(2000) send("{PGUP}" & "{DOWN 3}" & "{F1}" & "Inactive" & "{ENTER}") ; Generate random number between 1000 and 80000 then ad the AV to front and ask user if there was an error and if so then regenerate and retry. ; This area will create a random number, See if that AV###### has an lws and then verify if it exists. If it does exist ;then it will create another one and look again. Local $AVTaken = "yes" While $AVTaken == "yes" $RNDM = Random(1000, 800000, 1) ; Return an integer between 5 and 20 to determine the length of the string. Local $AVNumber = ("AV" & $RNDM) Send("{UP 2}" & "{F1}" & $AVNumber & "{ENTER}") Sleep(2000) Local $AVAnswer = MsgBox(BitOR($MB_YESNO, $MB_SYSTEMMODAL, $MB_TOPMOST), "LWS Exists for AV###?", "Is there an lws already for this AV###? (Yes/No)") if $AVAnswer == "7" Then sleep(2000) Send("{UP 3}" & "{F1}" & $AVNumber & "{ENTER}") $AVTaken = "no" Sleep(2000) Exit EndIf sleep(2000) WEnd EndIf EndIf EndSwitch WEnd EndFunc ;==>ManualEntryFunc ;----------------Multiple PC name sheet entries----------------------- Func ExcelEntriesFunc() EndFunc ;==>ExcelEntriesFunc ;ExcelEntriesFunc() ComputerDecomm.au3
  13. Thank you for your time first of all. The code I am working on is to remove all information of a computer on a specific application for either a single pc name or multiple PC names. I have the code working with copy and pasting of a single pc name but now I want to add the function that will allow hopefully the copy and pasting of multiple strings either from excel into an array and run through the list until all are removed from that application. I would like to copy from excel or text file and into a gui window that will take the input and create the array then create a the list and go down the list showing as they are removed until you reach the end. This has been problematic. I cannot find any info online about copying a group of strings then pasting into a Autoit Window and having it create the array with that input. Does this sound familiar with anyone? I could just copy that info into an excel file and input into the array from there but that wouldn't be as graceful and would take more time and steps then a simple copy data then paste into window and create array. I can put the code I do have in the ticket but the new function doesn't have much to do with the code in the rest of the program just yell if you need it. Thank you!
  14. TY. I was able to get it working like this. RunAsWait ($Username, "SLSS12.MYCOMP-INT.ORG", $Password, $RUN_LOGON_NETWORK, 'RUNDLL32.EXE PRINTUI.DLL,PrintUIEntry /Ss /n' & $Filepath & ' /a ' & $FileNamePath & '') TY for the nudge in the right direction.
  15. Sorry one more question. I am replacing the text in the line with variables. How would I format it if I got rid of the static line with variables like this? Its not working currently with added variables. I am sure its grammar once again. GetPrintServer() GetPrinterName() GetFileName() $Filepath = "\\" & $PrintServer & "\" & $PrinterNameString RunAsWait ($Username, "SLSS12.MYCOMP-INT.ORG", $Password, $RUN_LOGON_NETWORK, 'RUNDLL32.EXE PRINTUI.DLL,PrintUIEntry /Ss /n $Filepath /a "\\pepeps007\printer_configs$\DATs\" & $FileNameString') The filepath is coming out correctly with MSGBOX so it should be going to the correct print server and printer like I had put it in as text but its not connecting with the printer when adding it as a variable. Output of Filepath: \\PRINTSERVER\ITD0042 which is correct. How would the grammar change when taking out the text and replacing with variables? Thank you!
  16. So update.. I have verified that this command is working in command prompt. RUNDLL32.EXE PRINTUI.DLL,PrintUIEntry /Ss /n "\\PRINTSERVER\ITD0042" /a "\\pepeps007\printer_configs$\DATs\config.dat" This is my current line and its almost running! There are no errors and grammar seems correct. Only thing is that Its still not recognizing the /a RunAsWait ($Username, "SLSS12.MYCOMP-INT.ORG", $Password, $RUN_LOGON_NETWORK, 'RUNDLL32.EXE PRINTUI.DLL,PrintUIEntry /Ss /n', "\\PRINTSERVER\ITD0042", '/a', "\\pepeps007\printer_configs$\DATs\config.dat") temp.au3 Can anyone think of any other grammar rules that the /a needs to be surrounded by? Its not erroring out currently but its acting like it does not see the /a.
  17. Afternoon all, I am working on a PRINTUI script that does various things but at the moment I am tackling exporting drivers from a network server to another domain location. this is the case I have so far. Case $Exportdriverb GetPrintServer() GetPrinterName() $Filepath = "\\" & $PrintServer & "\" & $PrinterNameString $DriverFilePath = "\\EPEPS007\printer_configs$\DATs\config.dat" RunAsWait ($Username, "SL6.MYCompany-INT.ORG", $Password, $RUN_LOGON_NETWORK, 'RUNDLL32.EXE PRINTUI.DLL,PrintUIEntry /Ss /n ' & $FilePath /a "\\EPEPS007\printer_configs$\DATs\config.dat") This is only the case section but it stands alone other then variables coming into it. I use the RunAsWait command in other area's of the script and it works. I also tried this and it gave me an unknown function name error. RunAsWait ($Username, "SL6.MYCompany-INT.ORG $Password, $RUN_LOGON_NETWORK, 'RUNDLL32.EXE PRINTUI.DLL,PrintUIEntry /Ss /n ' "\\PRINTER\ITD0042" /a "\\EPPEPS007\printer_configs$\DATs\config.dat") This section works to bring up printer properties with no issues so most of the script is correct. It seems to not like the /a but not sure. RunAsWait ($Username, "SL6.MYCompany-INT.ORG", $Password, $RUN_LOGON_NETWORK, 'RUNDLL32.EXE PRINTUI.DLL,PrintUIEntry /p /n ' & $FilePath & '', "") According to microsoft this is the format it should take: RUNDLL32.EXE PRINTUI.DLL,PrintUIEntry /Ss /n "printer" /a "file.dat" I am sure I am just putting the arguements in wrong but have tried everything I can think of. It doesn't like the /a. but according to microsoft and all other websites out there it should be in there. Any help is appreciated. Thank you.
  18. This is for automating on Domain Network Print Servers the importing of print driver configuration files. So if you go into a print driver on a computer (or a print server print manager driver; there is an Import tab that you use to import the driver settings either on a computer or a printer server. The print driver is already installed. Its just getting the settings changed. I am looking to automate this import of driver config on a domain print server. Does anyone know the easiest way to do this? Would this be possible with AutoIT or possible with WMI or Powershell? Just wondering what the easiest way to do it VIA script would be.
  19. So you do not have any general information on where to go on this? I do not have a script yet because I do not know where to start. I have looked all over for information pertaining to this but I have not found any. As my post stated this is a general question on how this can be done with AutoIT. Maybe previous scripts that deal with this or how AutoIT would handle this. I don't even know where to start..... I don't have a script to proof read yet. I just need general information for now if possible. I love using AutoIT but I have not seen anyone try to use it for this purpose.
  20. Morning, In my company due to changes or updates in the system we have to re-import driver config settings on our print servers. This is a real pain since we have normally about 9 print servers to update so to do this manually and go into each and import the driver and print a test page and send a calibration request under the tools tab on each server for one printer takes a long time. I have found some information on working with print servers like the printmgr.au3 script which is good information but does not show how to do things more granular like go into a driver on a specific domain server and say go to the first server, 1. Import a config file from somewhere on the network 2. send a calibration request on the tools tab. 3. Printmgr.au3 does show how to send a test page so I could probably use this functionality. Then go to the next server and continue the process until all servers are updated. Has anyone seen any information on how to do this with AutoIt? I have looked around quite a bit and not seen anyone attempt to be as granular as this. Thank you for any input! I am right now trying to find out how this can be done since I am not finding much information on it.
  21. Thank you Subz. I will Look over your code to improve mine. I appreciate it. I am totally new so all input is appreciated!
  22. Thank you Nine. Its working now. One strange thing left though is that after it runs through the loop if the $EpicProd is checked it removes the changes the label on the line "$EpicProd = GUICtrlCreateCheckbox("Epic Prod", 8, 120, 70, 17) ;41,17" It changes the words Epic Prod to Checked. Both other lines are not changed if they are checked or not checked but that one. Can't see why that one line changes but not the other two. none of them should change but this one does for some reason.
  23. I created a GUI with a selection of 3 check boxes that if checked should run each of those selected then move on in the script. I pulled the GUI out of my main script and including it. I cannot see why its not running the items I select then dropping out of the loop. I know I must be missing something small but not sure what it is. If I do not select anything it drops out of the loops but if I choose just one it will run each if statement but will not drop out of the loop. It looks like it continues in the loop for some reason. Any Pointers are appreciated since I have not been able to find the solution myself yet. Thank you. P.S: I just copied the #include from main script so I know there seems to be alot that are not needed for this small script. Checkboxtest.au3
×
×
  • Create New...