Jump to content

PsychOfMSE

Members
  • Posts

    15
  • Joined

  • Last visited

Everything posted by PsychOfMSE

  1. The UDF describes the return as: ; Return values .: Success - 2D-Array with CSV data (0-based) Being relatively unfamiliar with arrays, your code looks like it should do exactly what I need it to do, and looks to be easy enough to expound upon to add in the additional functionality I want to implement. As long as that snippet will work with the return value of the _ParseCSV function returns, that looks like exactly what I need...and it clarifies a LOT with arrays for me. Thank you so much!
  2. So this should be very simple for you guys, but I've been banging my head against the wall for a while now and I'm running out of time getting an example script set up. Basically what i'm doing is using ProgAndy's CSV UDF to parse a CSV with 3 columns and n amount of rows. The structure of the CSV is: Hostname IP AgentType TEST001 192.168.1.1 1 TEST002 192.168.1.2 2 TEST003 192.168.1.3 1 TEST004 192.168.1.4 2 $Data = _ParseCSV('C:\test.csv', ",", '"', 0) So now I have a variable, $Data. What I want to do is create a loop that will go through each row and run a command using data from each column as variables. It's basically going to be a loop to a RunWait for a program that I'll be inserting the data from each column into the command line syntax as a variable, example: ;If Hostname field is populated but IP field is not use the command: RunWait('C:\Example.exe -Hostname="TEST001" -AgentType="1"') ;If IP field is populated but hostname is not, use the command: RunWait('C:\Example.exe -IP="192.168.1.1" -AgentType="1"') ;If both fields are populated default to using the IP address RunWait('C:\Example.exe -IP="192.168.1.1" -AgentType="1"') The CSV could have any amount of rows, maybe up to 2000+ rows, but will always have 3 columns. I'm sure this is an easy solution for you guys, but I'm running out of time and I just can't wrap my head around it. Arrays are one of the last pieces of AutoIT that is truly evading my comprehension. I'm the kind of person that learns best by being shown examples that directly relate to my problem and then tailoring that to fit my solution and then memorybanking it for later use. Thank you all so much!
  3. ShellExecuteWait("C:\Temp\TAGInstall\autologon.exe", $username & $domain & $password) This line is simply passing 3 pre-defined variables into the Microsoft Autologon.exe program. The problem I'm getting is that the program errors out and says "Usage: autologon <username> <domain> <password>". This leads me to believe that the command line arguments aren't being formatted correctly for some reason. Can anyone look at the line above and see why autoit wouldn't be passing the variables cleanly? Thanks! *EDIT* I've figured out the issue. The following line works perfectly: RunWait("C:\Temp\TAGInstall\autologon.exe" & " " & $username & " " & $domain & " " & $password)
  4. So I have a program that updates software on an end user device. When it comes time for a reboot it will utilize the following script: #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $r = "2" _main() Func _main() $MyGUI = GUICreate("Reboot Needed", 493, 120, 192, 114) $Message = GUICtrlCreateLabel("Windows needs to reboot your system to complete system changes. Please save your work and click" & @CRLF & "Reboot. Or click Delay to Postpone the operation for 30 minutes. You may postpone " & $r & " more times.", 0, 8, 601, 75) $Button1 = GUICtrlCreateButton("Reboot", 50, 70, 153, 41) $Button2 = GUICtrlCreateButton("Delay", 300, 70, 137, 41) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE _main() Case $Button1 Shutdown(6) Case $Button2 GUIDelete() _delay() EndSwitch WEnd EndFunc Func _delay() $r -= 1 Sleep(10000) _main() EndFunc What I need is a timeout on this box. Say if the user doesn't select Reboot or Delay within 30 seconds it will default to rebooting the device. Is this possible and if so how would I go about it? Thanks!
  5. Yes. My first hurdle is to get the AutoIt syntax for the run command to execute, then I can look at other issues. Right now I can't even get the application to launch.
  6. I currently have: Run(@SystemDir & '\msiexec.exe /i "C:\AutoItDragon\Dragon NaturallySpeaking 10.msi" SERIALNUMBER=Removed-For-Privacy REBOOT=ReallySuppress ADDLOCAL=ALL NAS_ADDRESS=Removed.For.Privacy.Net NAS_LDAP_SIGN_ON=2 NAS_SINGLE_SIGN_ON=1 QUICKSTART=0 WEBREGISTRATION=0 PRODUCTUPDATEFLAG=-1 /log C:\InstallDragon10.1.log /qn') Can anyone see a reason why this wouldn't be running the application correctly? It seems as if it's not passing the command line parameters through to the installer.
  7. #AutoIt3Wrapper_Res_Comment=CHI Citrix Uninstaller #AutoIt3Wrapper_Res_Description=This application will uninstall any version of Citrix Online Plugin #AutoIt3Wrapper_Res_Fileversion=1.0.1.0 #AutoIt3Wrapper_Res_FileVersion_AutoIncrement=P #AutoIt3Wrapper_Res_ProductVersion=1.0 #AutoIt3Wrapper_res_requestedExecutionLevel=requireAdministrator #AutoIt3Wrapper_Icon=favicon.ico Global $x86 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\ICA Client\", "ClientName") Global $x64 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Citrix\ICA Client\", "ClientName") Global $receiver_Present = FileExists("C:\ProgramData\Citrix\Citrix Receiver (Enterprise)\TrolleyExpress.exe") Global $receiver_Present_2 = FileExists("C:\ProgramData\Citrix\Citrix Receiver\TrolleyExpress.exe") Global $PNAgent_x64_Upgrade = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Citrix\PluginPackages\XenAppSuite\PN_Agent\", "Version") Global $PNAgent_x86_Upgrade = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\PNAgent\", "Version") Global $Dragon_x64 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Voice\SpeechRecognition\Engine", "Dragon NaturallySpeaking") Global $Dragon_x86 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Voice\SpeechRecognition\Engine", "Dragon NaturallySpeaking") Global $Dragon_Installed Global $Dragon_Installed_x64 Global $Dragon_Installed_x86 If Not $Dragon_x64 = "" Then $Dragon_Installed_x64 = 1 If Not $Dragon_x86 = "" Then $Dragon_Installed_x86 = 1 If $Dragon_Installed_x64 = 1 Or $Dragon_Installed_x86 = 1 Then $Dragon_Installed = 1 If Not FileExists(@ProgramFilesDir & "\Citrix\") then Exit IniWrite(@tempdir & "\ClientName.ini", "section1", "ClientName", $x86) IniWrite(@tempdir & "\ClientName.ini", "section2", "ClientName", $x64) Func Cleanup() FileDelete(@TempDir & '\ReceiverCleanupUtility.exe') ;File Cleanup FileDelete(@TempDir & '\CitrixUninstallPrevious.bat') ;File Cleanup EndFunc ;==>Cleanup ;File installation from executable FileInstall("C:\AutoItCitrix\CitrixUninstallPrevious.bat", @TempDir & "\", 0) FileInstall("C:\AutoItCitrix\ReceiverCleanupUtility.exe", @TempDir & "\", 0) ;This block will check for remotescan and if it exists then exits. If FileExists("C:\Program Files (x86)\RemoteScan Server\server.ini") Then Call("Cleanup") Exit ElseIf FileExists("C:\Program Files\RemoteScan Server\server.ini") Then Call("Cleanup") Exit Else EndIf ;Checks for Citrix receiver and exits if present. If $receiver_Present = 1 Then Call("Cleanup") Exit Else EndIf ;Checks for Citrix receiver and exits if present. If $receiver_Present_2 = 1 Then Call("Cleanup") Exit Else EndIf ;Checks for Citrix PNAgent 12.3.0.8 and if it exists then exits. While Not StringInStr($CmdLineRaw, 'Disable_12_3_Skip="True"', 0, 1) If $PNAgent_x64_Upgrade = "12.3.0.8" Then Call("Cleanup") Exit ElseIf $PNAgent_x86_Upgrade = "12.3.0.8" Then Call("Cleanup") Exit EndIf Wend ;Uninstall any previous citrix version FileChangeDir(@TempDir) RunWait(@ComSpec & " /c " & "CitrixUninstallPrevious.bat" & " /c ", "", @SW_HIDE) FileChangeDir(@TempDir) RunWait(@ComSpec & " /c " & "ReceiverCleanupUtility.exe" & " /silent ", "", @SW_HIDE) DirRemove(@ProgramsCommonDir & "\Citrix\", 1) Call("Cleanup") IniWrite(@TempDir & "\UninstallPrevious.ini", "section1", "Uninstall", "True") Shutdown(6) The script is working fine on my end but when some users at different sites try to run it the script will uninstall Citrix just fine but will not reboot and just sits in the task tray indefinitely. The majority of the issues are coming from Windows XP devices, Windows 7 devices seem to work just fine. Can anyone see anything glaringly wrong?
  8. Can anyone help me out please? I'm at a crossroads on my script and i'm not sure how to format this command.
  9. #RequireAdmin FileDelete(@DesktopCommonDir & "\dragon medical 10.1.lnk") I have created the .lnk file on my desktop and when I run the script the file is not deleted. This is on Windows 8. FileRecycle does not seem to remove the file either. Any ideas? ***Nevermind! I figured it out, sorry about that! Mods, could you please delete? ***
  10. Hey guys, I'm on a tight timetable so I was hoping someone could help me out. I need to run an .exe with command line flags in autoit: Setup.exe /S /v"SERIALNUMBER=Removed-For-Privacy REBOOT=ReallySuppress ADDLOCAL=ALL NAS_ADDRESS=removed.for.privacy.net NAS_LDAP_SIGN_ON=2 NAS_SINGLE_SIGN_ON=1 QUICKSTART=0 WEBREGISTRATION=0 PRODUCTUPDATEFLAG=-1 /log C:InstallDragon10.1.log /qn" How would I go about formatting that in Autoit? Thanks all!
  11. The MSI wrapper is required by corporate policy. Not sure why, but our SCCM team is extremely strict with this requirement. I can wrap it in an .msi wrapper just fine, but my problem lies in the $CmdLine[2] pass through in: RunWait('CitrixOnlinePluginFull.exe ADDLOCAL="ICA_Client,PN_Agent,SSON" SERVER_LOCATION="' $CmdLine[2] '"') This is vital for passing citrix command line switches through into the executable. If I wrap this in an .msi will the passthrough still occur? Following scenario: Re-Wrap to .msi and run the following command in SCCM: CHI_LR_Citrix_Upgrade.msi /silent ADDLOCAL="ICA_Client,PN_Agent,SSON" SERVER_LOCATION="http://xenapp" ENABLE_DYNAMIC_CLIENT_NAME="NO" Will "/silent ADDLOCAL="ICA_Client,PN_Agent,SSON" SERVER_LOCATION="http://xenapp" ENABLE_DYNAMIC_CLIENT_NAME="NO"" still be passed through to $CmdLine[2] ?
  12. FileInstall("C:\AutoItCitrix\CitrixOnlinePluginFull.exe",@TempDir) FileInstall("C:\AutoItCitrix\CitrixUpdate.bat",@TempDir) If @OSArch = "X86" Then $regAddress = 'HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\ICA Client\Engine\Lockdown Profiles\All Regions\Lockdown\Client Engine' $regKey = 'ClientName' $regPath_x86 = RegRead($regAddress,$regKey) FileChangeDir(@TempDir) RunWait("CitrixUpdate.bat") FileChangeDir(@TempDir) RunWait('CitrixOnlinePluginFull.exe ADDLOCAL="ICA_Client,PN_Agent,SSON" SERVER_LOCATION="' $CmdLine[2] '"') RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\ICA Client\Engine\Lockdown Profiles\All Regions\Lockdown\Client Engine", "ClientName", "REG_SZ", $regPath_x86) RegWrite("HKEY_CURRENT_USER\SOFTWARE\Citrix\ICA Client\Engine\Lockdown Profiles\All Regions\Lockdown\Client Engine", "ClientName", "REG_SZ", $regPath_x86) Else $regAddress = 'HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Citrix\ICA Client\Engine\Lockdown Profiles\All Regions\Lockdown\Client Engine' $regKey = 'ClientName' $regPath_x64 = RegRead($regAddress,$regKey) FileChangeDir(@TempDir) RunWait("CitrixUpdate.bat") FileChangeDir(@TempDir) RunWait('CitrixOnlinePluginFull.exe ADDLOCAL="ICA_Client,PN_Agent,SSON" SERVER_LOCATION="' $CmdLine[2] '"') RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Citrix\ICA Client\Engine\Lockdown Profiles\All Regions\Lockdown\Client Engine", "ClientName", "REG_SZ", $regPath_x64) RegWrite("HKEY_CURRENT_USER\SOFTWARE\Wow6432NodeCitrix\ICA Client\Engine\Lockdown Profiles\All Regions\Lockdown\Client Engine", "ClientName", "REG_SZ", $regPath_x64) EndIf Here's my current script. I now need to convert this to a MSI package so we can push it out through SCCM. How do I go about passing a command line variable during install through an .msi into this script? Is it possible? Thanks!
  13. I assume that would be done like: $RegValue_x86 = Eval($regPath_x86) And then call the $RegValue_x86 variable?
  14. Ah, now I see a new problem. The "CitrixUpdate.bat" file uninstalls any previous citrix installation which also removes the reg value I am trying to call in the install. Is there any way I can get around this? I guess I need to write the $regpath variable to be able to be called later?
  15. Here's my script: FileInstall("C:\AutoItCitrix\CitrixOnlinePluginFull.exe",@TempDir) FileInstall("C:\AutoItCitrix\CitrixUpdate.bat",@TempDir) FileChangeDir(@TempDir) RunWait("CitrixUpdate.bat") If @OSArch = "X86" Then $regAddress = 'HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\ICA Client\Engine\Lockdown Profiles\All Regions\Lockdown\Client Engine' $regKey = 'ClientName' $regPath_x86 = RegRead($regAddress,$regKey) FileChangeDir(@TempDir) RunWait('CitrixOnlinePluginFull.exe ADDLOCAL="ICA_Client,PN_Agent,SSON" ENABLE_DYNAMIC_CLIENT_NAME="No" CLIENT_NAME='$regPath_x86' SERVER_LOCATION="Http://xenapp"') Else $regAddress = 'HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Citrix\ICA Client\Engine\Lockdown Profiles\All Regions\Lockdown\Client Engine' $regKey = 'ClientName' $regPath_x64 = RegRead($regAddress,$regKey) FileChangeDir(@TempDir) RunWait('CitrixOnlinePluginFull.exe ADDLOCAL="ICA_Client,PN_Agent,SSON" ENABLE_DYNAMIC_CLIENT_NAME="No" CLIENT_NAME='$regPath_x64' SERVER_LOCATION="Http://xenapp"') Basically what I need to do is pull the "ClientName" value from the registry and insert it into the "Client_Name" command line switch in the "RunWait" line. What am I doing wrong? How would I go about inserting the readout of the Reg Value into the command line switch? Thanks so much guys! (I'm a noobie BTW!, please go easy on me. I've been doing nothing but searching and using the help file all day). This is my first script.
×
×
  • Create New...