Jump to content

DietCoke

Active Members
  • Posts

    29
  • Joined

  • Last visited

DietCoke's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Thank you Grimm, that did the trick! DC
  2. Hi, I've got an installer that is giving me the following error: Line 3526 (File "RSA411.exe"): Error: Error in expression The problem that I am running into is that this installer is working on a couple of PCs, but not the vast majority of them. I know the scripting is not the best out there, but it has worked in the past - they don't pay me to code, but I can hack enough of it together to make the job easier usually. I have stripped out the company info, IP addresses, etc, but otherwise it is intact. The software installs a piece of software, then emails two different email addresses so a config file can be created by the pertinent teams. Any help is appreciated. Thanks, DC #include <INet.au3> #RequireAdmin ; SID get function $Domain = EnvGet("USERDOMAIN") Func _GetSID($Username, $UserDomain = '') Local $objWMIService, $objAccount If $UserDomain = '' Then $UserDomain = EnvGet("USERDOMAIN") $objWMIService = ObjGet("winmgmts:\\.\root\cimv2") $objAccount = $objWMIService.Get _ ("Win32_UserAccount.Name='" & @Username & "',Domain='" & $UserDomain & "'") Return $objAccount.SID EndFunc WinMinimizeAll() Local $var = Ping("XXX.XXX.XXX.XXX", 250) If $var Then; also possible: If @error = 0 Then ... ; Check to see if RSA client has already been installed, if so notify user If FileExists (@MyDocumentsDir &"\rsainstalled.txt") Then MsgBox(1, "Company Name", "Your RSA SecurID software has already been installed." & @CRLF & "If you cannot locate it, please contact the Helpdesk at x6735." & @CRLF & "Please click OK to continue.", 20) Exit EndIf MsgBox(0, "Step 1/3", "You are about to install RSA SecurID token software. This is a silent " & @CRLF & "installation that will take up to 3 minutes. Please do not use the PC until " & @CRLF & "the installation is complete." & @CRLF & @CRLF & " Please click OK to continue", 20) MsgBox(0, "Company Name", "Please note that your physical SecurID card is not used " & @CRLF & "at any point in this process. Please click OK to continue.", 20) ; Install RSA SecurID client silently ShellExecute("msiexec", "/i" & "RSA411.msi /quiet") ; Wait for 120 seconds for RSA SecurID client to finish installing Sleep(120000) ; Check to see if install is done If FileExists (@ProgramFilesDir & "\RSA SecurID Software Token\SecurID.exe") Then ; Email network team with account SID, username and hostname $s_SmtpServer = "x.x.x.x" $s_FromName = "RSA Installation Notifier" $s_FromAddress = "email address" $s_ToAddress = "email address" $s_Subject = "RSA - Hostname: " & @ComputerName & " - Username: " & @USERNAME & " - SID: " & _GetSID(@UserName, $Domain) Dim $as_Body[3] Local $aResult = _Date_Time_GetTimeZoneInformation() Local $bias = -$aResult[1] / 60 Local $biasH = Int($bias) Local $biasM = 0 If $biasH <> $bias Then $biasM = Abs($bias - $biasH) * 60 $bias = StringFormat(" (%+.2d%.2d)", $biasH, $biasM) $as_Body[0] = "RSA Client installed by: " & @USERNAME $as_Body[1] = "Installed on the following PC: " & @ComputerName $Response = _INetSmtpMail ($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body,"","-1") $err = @error $s_SmtpServer2 = "x.x.x.x" $s_FromName2 = "RSA Installation Notifier" $s_FromAddress2 = "email address" $s_ToAddress2 = "email address" $s_Subject2 = "RSA - Hostname: " & @ComputerName & " - Username: " & @USERNAME & " - SID: " & _GetSID(@UserName, $Domain) Dim $as_Body[3] Local $aResult = _Date_Time_GetTimeZoneInformation() Local $bias = -$aResult[1] / 60 Local $biasH = Int($bias) Local $biasM = 0 If $biasH <> $bias Then $biasM = Abs($bias - $biasH) * 60 $bias = StringFormat(" (%+.2d%.2d)", $biasH, $biasM) $as_Body[0] = "RSA Client installed by: " & @USERNAME $as_Body[1] = "Installed on the following PC: " & @ComputerName $Response = _INetSmtpMail ($s_SmtpServer2, $s_FromName2, $s_FromAddress2, $s_ToAddress2, $s_Subject2, $as_Body,"","-1") $err = @error If $Response = 1 Then Else MsgBox(0, "Company name", " There seems to be a problem with this installation." & @CRLF & "Please contact Helpdesk at --------- for assistance.") EndIf ; Notify user that installation is complete, and that action is required by network team MsgBox(0, "Company name", "The RSA SecurID application has been successfully installed. You " & @CRLF & "will be contacted by Network Support within 48 hours" & @CRLF & "to complete the setup process.", 0) ; file to Windows directory so installer knows that it has already been installed before FileCopy("\\share\rsainstalled.txt", @MyDocumentsDir &"\rsainstalled.txt" ,9) ; Copy documentation FileCopy("\\share\Instructions to download token.doc", @DesktopDir &"\Instructions to download token.doc" ,9) FileCopy("\\share\Instructions to import token and setup Pin.doc", @DesktopDir &"\Instructions to import token and setup Pin.doc" ,9) Exit ElseIf ; Notify user that the installation appears to have issues and to call the Helpdesk MsgBox(0, "Company name", " There seems to be a problem with this installation." & @CRLF & "Please contact Helpdesk at ---------- for assistance.") EndIf Else MsgBox(1, "Company name", "You must be online to perform this installation. Please ensure that " & @CRLF & "you are connected to the network, either in an office or via VPN.") MsgBox(1, "Company name", "You must be online to perform this installation. Please ensure that " & @CRLF & "you are connected to the network, either in an office or via VPN.") EndIf Exit
  3. Thanks again to both of you! I ended up spinning my wheels quite a bit, but Water, I found an example that you provided that I was able to easily retrofit (post #214): I have retrofitted it below to back up the following items: * Calender * Contacts * Journal * Notes * Tasks * To-Do's As stated previously, this does not back up any mail. #include <OutlookEx.au3> #include <array.au3> $iOL_Debug = 2 $oOutlook = _OL_Open() ConsoleWrite("OO: " & @error & "-" & @extended & @CRLF) $oPST = _OL_PSTCreate($oOutlook, "C:\temp" & "\" & @YEAR & "-" & @MON & "-" & @MDAY & "-" & @UserName & ".pst", @YEAR & "-" & @MON & "-" & @MDAY & "-" & @UserName) ConsoleWrite("PC: " & @error & "-" & @extended & @CRLF) #cs Global Const $olFolderCalendar = 9 ; Calendar folder Global Const $olFolderContacts = 10 ; The Contacts folder Global Const $olFolderDeletedItems = 3 ; The Deleted Items folder Global Const $olFolderDrafts = 16 ; The Drafts folder Global Const $olFolderInbox = 6 ; The Inbox folder Global Const $olFolderJournal = 11 ; The Journal folder Global Const $olFolderJunk = 23 ; The Junk E-Mail folder Global Const $olFolderNotes = 12 ; The Notes folder Global Const $olFolderOutbox = 4 ; The Outbox folder Global Const $olFolderSentMail = 5 ; The Sent Mail folder Global Const $olFolderTasks = 13 ; The Tasks folder Global Const $olFolderToDo = 28 ; The To Do folder Global Const $olFolderRssFeeds = 25 ; The RSS Feeds folder #ce $aFolder = _OL_FolderAccess($oOutlook, "" , $olFolderCalendar) $bFolder = _OL_FolderAccess($oOutlook, "" , $olFolderContacts) $cFolder = _OL_FolderAccess($oOutlook, "" , $olFolderJournal) $dFolder = _OL_FolderAccess($oOutlook, "" , $olFolderNotes) $eFolder = _OL_FolderAccess($oOutlook, "" , $olFolderTasks) $fFolder = _OL_FolderAccess($oOutlook, "" , $olFolderToDo) ConsoleWrite("FA: " & @error & "-" & @extended & @CRLF) _OL_FolderCopy($oOutlook, $aFolder[1], $oPST) _OL_FolderCopy($oOutlook, $bFolder[1], $oPST) _OL_FolderCopy($oOutlook, $cFolder[1], $oPST) _OL_FolderCopy($oOutlook, $dFolder[1], $oPST) _OL_FolderCopy($oOutlook, $eFolder[1], $oPST) _OL_FolderCopy($oOutlook, $fFolder[1], $oPST) ConsoleWrite("FC: " & @error & "-" & @extended & @CRLF) _OL_PSTClose($oOutlook, $oPST) ConsoleWrite("PC: " & @error & "-" & @extended & @CRLF) _OL_Close($oOutlook) ConsoleWrite("OC: " & @error & "-" & @extended & @CRLF) MsgBox(4096,"Titlebar info here.","Test export complete... ") Thank you again!
  4. Thanks to both you and Water. I'm actually looking to back up everything *but* mail if possible. Critical items are contacts, notes & calender. The goal is to make a local PST and backup the aforementioned items from the Exchange server to it. I understand the differentiation between ItemExport and ItemCopy, but is there a constant for an Exchange mailbox? Somewhere where I can just specify the folder I (example, this is definitely non-working code): _OL_ItemCopy($oOutlook, $aOL_ItemContacts[1][0], Default, "C:Outlook-UDF-TestTargetFolderContacts")
  5. Yes, however it doesn't seem like _OL_ItemExport will output that data to pst. Am I missing something?
  6. I need to export all mailbox items *other than email* from an Exchange mailbox into single purpose pst files (ex. calender.pst, contacts.pst, etc). In looking through the Outlook.udf threads I'm not seeing anything specific to that. Am I missing something or is this functionality not there?
  7. Hi, I've tried a number of different options in trying to copy over 4 files to the Program Files directory, when run within Windows 7. I have turned UAC down to the lowest level, with no success. I've also tried adding: #RequireAdmin #AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator Neither of which seem to be doing anything. I'm receiving no prompts, etc. I have confirmed that the locations are correct and I'm using fully qualified paths. Any suggestions? Thanks in advance!
  8. That is helpful - but can I combine these at all? I tried the below as an example but it didn't work: Case @OSArch = 'X64' & @OSVersion = 'WIN_7' MsgBox(4096,"OS version and architecture","Windows 7 64-bit") Essentially I need to be able to define 4 different ShellExecutes for 4 different OS/architecture types.
  9. I'm looking to build an app that will check for the following: 1. OS and whether it is 32 or 64-bit 2. Based on that finding, execute a particular application. I've looked through here pretty thoroughly but haven't been able to locate the correct resource. I have considered running a standalone OS checker to address item 1, but the conditions in #2 need to rely on active text and that doesn't appear to be doable without winwaitactive. As there are four choices that will be available, I'm worried that winwaitactive will stall if the first line isn't found. Any suggestions or doc links are appreciated! Thank you.
  10. Got it! Thank you so much - you explained it perfectly, and I was able to understand the documentation after seeing your code. Thanks for the quick response and help!
  11. Hi, I've got the following Msgbox: MsgBox(4, "Beginning SAP 7.20 upgrade...", "Please wait, starting SAP 7.20 upgrade.") I put the flag 4 (see http://www.autoitscript.com/autoit3/docs/functions/MsgBox.htm for reference) with the expectation that clicking "Yes" would proceed, and "Non" would cancel or close. I've also tried this with flag 1. The problem I have is that regardless of which button is pressed, they all just proceed on to the next step, as though I had clicked "Yes". Why is this? Is my syntax wrong or am I expecting too much from this function? Thanks for any insight!
  12. Thank you so much! Wow - one character and one line movement between me and success on this one... great info also in hitting F5 before a compile. Here's the finalized code, tested here successfully: #include <INet.au3> $Idrive = DriveMapGet ("x:") if $idrive == "" then ;DriveMapAdd("X:", "\\server\folder", 1) Else $s_SmtpServer = "SMTP Server" $s_FromName = "From Name" $s_FromAddress = "Sender email address" $s_ToAddress = "Recipient email address" $s_Subject = "Customer has pre-existing X drive" Dim $as_Body[1] $as_Body[0] = "PC contains mapped drive issue for username: " & @USERNAME & " from PC name: " & @ComputerName $Response = _INetSmtpMail ($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body,"","-1") Endif Thanks to Bowmore and bogQ - you guys really helped today!
  13. Thank you - that makes sense, I appreciate the tip! However, after putting the include up at the top I'm now getting the error: Line 3441 (File "C:\AutoIt_Code\map_src.exe"): Error: Error in expression. Any ideas? I wish the errors truly related to lines. Thank god I don't have 3441 lines of code for this item.
  14. Hi, I'm trying to build out a script (based in part by different portions of code I've used here and a bit on my own) that will check the following: If drive X is being used; If drive X is being used, email to an email address with notification If drive X is not being used, map the drive to a predefined path I've started with this code: $Idrive = DriveMapGet ("x:") if $idrive == "" then DriveMapAdd("X:", "\\dept\pub$", 1) Else #include <INet.au3> $s_SmtpServer = "SMTP Server" $s_FromName = "Mapping issue notifier" $s_FromAddress = "From address" $s_ToAddress = "To address" $s_Subject = "Subject line" Dim $as_Body[1] $as_Body[0] = "PC contains mapped drive issues for username: " & @USERNAME " from PC name: " & @ComputerName $Response = _INetSmtpMail ($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body,"","-1") Endif But when I do, I get the error: Line 212 (File""): Error: "If" statement has no matching EndIf statement. This has to be a syntax issue, but I'm not seeing anything wrong. I've worked on this for a couple of hours using different approaches and figured it was time for outside help. Does anyone have any suggestions? Thanks for any help or pointers!
×
×
  • Create New...