Jump to content

stev379

Active Members
  • Posts

    196
  • Joined

  • Last visited

Everything posted by stev379

  1. THANK YOU! I used the 2nd one and it worked perfectly the first time. This is a huge help with this audit. You are the man!
  2. How can I read a column in an Excel file and copy or cut the last 4 characters of column A into column B? I need to pull the year date to its own column so I can sort the rows by year. I have 1910 rows. Cell A:1 contents: Thu May 24 11:39:25 EDT 2012 It looks like _Excel_RangeRead is what I'll need, but I'm stuck on pulling the data for each cell before the array displays or yanking it out of the array. This all I have so far ...and it ain't right. It's 99% a copy from the Help file with my file path added. I can't find the old functions that I used to read and loop each cell in my old script. I added the 2nd to last line below. If it will loop and read each cell in column A, then I can handle the parsing and likely the writing to the next column. #include <Array.au3> #include <Excel.au3> #include <MsgBoxConstants.au3> ; Create application object and open an example workbook Local $oExcel = _Excel_Open() If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeRead Example", "Error creating the Excel application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended) Local $oWorkbook = _Excel_BookOpen($oExcel, @ScriptDir & "\WDEActivityReport-1910-062116.xlsx") If @error Then MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeRead Example", "Error opening workbook" & @ScriptDir & "\WDEActivityReport-1910-062116.xlsx" & @CRLF & "@error = " & @error & ", @extended = " & @extended) _Excel_Close($oExcel) Exit EndIf ; ***************************************************************************** ; Read the formulas of a cell range (all used cells in column A) ; ***************************************************************************** Local $aResult = _Excel_RangeRead($oWorkbook, Default, $oWorkbook.ActiveSheet.Usedrange.Columns("A:A"), 2) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeRead Example 3", "Error reading from workbook." & @CRLF & "@error = " & @error & ", @extended = " & @extended) MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeRead Example 3", "Data successfully read." & @CRLF & "Please click 'OK' to display all formulas in column A.") MsgBox(0,'', "Cell A:1 = " & $oWorkbook.ActiveSheet("A:1")) ;_ArrayDisplay($aResult, "Excel UDF: _Excel_RangeRead Example 3 - Formulas in column A")
  3. Even easier than I would have thought. Thanks for the help!! Answer was proper placement for $STDOUT_CHILD #include <AutoItConstants.au3> #include <GUIConstantsEx.au3> #include <Constants.au3> #include <MsgBoxConstants.au3> #include <Array.au3> ; Script Function: Run NSLookup using domain.com to make the entered name an FQDN so you don't need to type the entire FQDN ; Script ideas: Set it to read a list of names from a text file or spreadsheet. ; Set the return to priint to a text file or spreadsheet *** How do I read and return data from the cmd prompt window. Dim $IP $domain = "" ;Enter your primary DNS suffix as .name.com NSLOOKUP() Func NSLOOKUP() Local $hGUI = GUICreate(@ScriptName) Local $BTN_NSLOOKUP = GUICtrlCreateButton("Run NSLookup", 310, 140, 85, 25) Local $LBL_DNSNAME = GUICtrlCreateLabel("Enter the machine's DNS shortname (Don't use the FQDN)", 25, 40, 300, 20) Local $INPT_DNSNAME = GUICtrlCreateInput("", 25, 60, 250, 25) Local $LBL_OUTPUT_IP = GUICtrlCreateLabel("", 25, 100, 390, 25) GUISetState(@SW_SHOW, $hGUI) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $BTN_NSLOOKUP $INPT_DNSNAME_RD = GUICtrlRead($INPT_DNSNAME) Local $PID = Run(@ComSpec & " /k NSLOOKUP " & $INPT_DNSNAME_RD & $domain, @SystemDir, @SW_SHOW, $STDOUT_CHILD) ProcessWaitClose($PID) $IP &= StdoutRead($PID) MsgBox(0, '', "IP = " & $iP) EndSwitch WEnd ; Delete the previous GUI and all controls. GUIDelete($hGUI) EndFunc ;==>NSLOOKUP Func _READFROMCONSOLE() If Not @Compiled Then MsgBox($MB_SYSTEMMODAL, "", "This script must be compiled in order to run the example.") Exit EndIf Local $sOutput While True $sOutput &= ConsoleRead() If @error Then ExitLoop Sleep(25) WEnd ; CHANGE THE LINE BELOW TO OUTPUT TO A TEXT FILE MsgBox($MB_SYSTEMMODAL, "", "Output from cmd prompt: " & @CRLF & @CRLF & $sOutput) EndFunc ;==>_READFROMCONSOLE
  4. Thanks for pointing me the right direction. Very much appreciated! I think I'm a little confused about whether i need to create 2 separate scripts, or if I can do it all in one, or if I need to do it with 2 and then use one as an included file. I'm guessing technically, it could be done any way, but what would the appropriate method be given my overall task?
  5. Yes, but it looks like I should read it again. (I'm getting over a neck injury and eager to get my brain working again now that I can sit up after being out for 3 weeks. They gave me painkillers 2 days ago and I'm a little cloudy). Very tired of doing nothing. Stupid neck. I'll read it again and tinker with things this afternoon. I'll reach out tomorrow if I'm still stuck. Thank you to both of your for responses....
  6. @ Jos - Thanks for the reply. I haven't seen any data returned with StdOutRead. Clearly, I'm doing something wrong. :-) Using the same code above and adding the two lines below to the loop returns an empty variable. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $BTN_NSLOOKUP $INPT_DNSNAME_RD = GUICtrlRead($INPT_DNSNAME) $PID = Run(@ComSpec & " /k NSLOOKUP " & $INPT_DNSNAME_RD & $domain, @SystemDir, @SW_SHOW) ProcessWaitClose($PID) ; ***** NEW LINE ***** $IP = StdoutRead($PID) ; ***** NEW LINE ***** MsgBox(0, '', "IP = " & $iP) EndSwitch WEnd
  7. Please don't give me the entire answer. I'd like to figure out as much on my own as i can, but need some nudging in the right direction. I've compiled the example script and I see how it works, but haven't figured out how to get my entire idea going. I need to run nslookup on multiple machines a few times each year and I'm using an input field to test with so others here could use the finished tool as well. Ideally, I'll have it read from a list, but that's another issue. PROBLEM: I don't know what functions to use or how to get them to read the response returned from nslookup out of the cmd prompt into a variable. I can split it down to the machine's name if it returns the entire text from the cmd prompt, but how do I pass returned info from nslookup to a variable (or the entire text of the window)? It returns the data after running nslookup in the cmd window that I left open. I need to write the returned data to a text file. I've looked at StdInWrite and StdOutRead as well. Thanks for any help or suggestions. #include <GUIConstantsEx.au3> #include <Constants.au3> #include <MsgBoxConstants.au3> #include <Array.au3> ; Script Function: Run NSLookup using ".Domain.com" to make the entered name an FQDN so you don't need to type the FQDN each time. ; Enter machine name, click run nslookup and it prints to an open cmd prompt window ; Need the returned IP address to be printed to a text file (HOW DO I MAKE THAT DATA IN THE CMD PROMPT INTO A VARIABLE? ; Script ideas: Set it to read a list of names from a text file or spreadsheet. ; Set the return to priint to a text file or spreadsheet *** How do I read and return data from the cmd prompt window. $domain = "" ; Add domain name here to complete the FQDN - Leave it empty if sharing offsite. NSLOOKUP() Func NSLOOKUP() ; Create a GUI with various controls. Local $hGUI = GUICreate(@ScriptName) Local $BTN_NSLOOKUP = GUICtrlCreateButton("Run NSLookup", 310, 140, 85, 25) Local $LBL_DNSNAME = GUICtrlCreateLabel("Enter the machine's DNS shortname (Don't use the FQDN)", 25, 40, 300, 20) ; If testing offsite, you may need to use the FQDN Local $INPT_DNSNAME = GUICtrlCreateInput("", 25, 60, 250, 25) Local $LBL_OUTPUT_IP = GUICtrlCreateLabel("", 25, 100, 390, 25) ; Display the GUI. GUISetState(@SW_SHOW, $hGUI) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $BTN_NSLOOKUP $INPT_DNSNAME_RD = GUICtrlRead($INPT_DNSNAME) $PID = Run(@ComSpec & " /k NSLOOKUP " & $INPT_DNSNAME_RD & $domain, @SystemDir, @SW_SHOW) ProcessWaitClose($PID) EndSwitch WEnd ; Delete the previous GUI and all controls. GUIDelete($hGUI) EndFunc ;==>NSLOOKUP
  8. Thanks for the reply. Yea, I first tired with Run or Runwait(@Comspec syntax, but had no luck, then found some stuff suggesting the other syntax. Though I might be seeing an error in my original @Comspec attempt now that I'm looking at it again. I'll give it a go again and let you know.
  9. What would be the correct syntax to change below from bat to AutoIT? The first 3 lines work fine. It's just the last 2 I'm not seeing changes with. But no error when I run it in SciTE. These are all already pushed by GPO, but the first 3 do allow me to change and then "show" the status. bat netsh interface 6to4 set state disabled netsh interface isatap set state disabled netsh interface teredo set state disabled netsh interface ipv6 set global randomizeidentifiers=disabled store=persistent netsh interface ipv6 set privacy state=disabled store=persistent Change to this for AutoIT #RequireAdmin ShellExecuteWait("netsh.exe", 'int set interface "6to4" enable', "", "", @SW_HIDE) ShellExecuteWait("netsh.exe", 'int set interface "isatap" enable', "", "", @SW_HIDE) ShellExecuteWait("netsh.exe", 'int set interface "teredo" enable', "", "", @SW_HIDE) ShellExecuteWait("netsh.exe", 'int set interface "ipv6" global randomizeidentifiers=disabled store=persistent', "", "", @SW_HIDE) ShellExecuteWait("netsh.exe", 'int set interface "ipv6" privacy state=disabled store=persistent', "", "", @SW_HIDE) Also tried this and some others with the quotes moved around. ShellExecuteWait("netsh.exe", 'int set interface "ipv6 global randomizeidentifiers=enabled store=persistent"', "", "", @SW_HIDE) ShellExecuteWait("netsh.exe", 'int set interface "ipv6 privacy state=enabled store=persistent"', "", "", @SW_HIDE) I'm running this to show the status: netsh interface ipv6 show global
  10. I work with the GPMC is on a VM that I RDP to. I need that RDP window to stop logging me out so frequently when I go to test a policy change on another machine and turn my head for 10 minutes. The next level up (of security staff), sets the 10 minute time limit policy so I can't edit that setting, but temporary circumvention is ok. I logon to the GPMC machine 25 times or more per day. Not exaggerating and I'm usually here for 12 hours so it's not as often as an 8 hour day. I've build a bunch of simple scripts with mouseclick or mouse move set to move the cursor a couple pixels and back again every 9 minutes. None of these seems to work though. They do move the mouse, but the machine will still go to sleep. I'm open to any alternate suggestions as well. Thanks for any help Sample 1 Sleep(500) For $i = 0 To 10000 $MPOS = MouseGetPos() Sleep(500) MouseMove($MPOS[0]+2, $MPOS[1]+2) MouseMove($MPOS[0], $MPOS[1]) Sleep(540000) Next Sample 2 $9_MINS = 54000 Sleep(3000) For $i=1 to 1000 MouseClick("Left", 300, 300, 1) Sleep($9_MINS) MouseClick("Left", 400, 100, 1) Sleep($9_MINS) MouseClick("Left", 500, 200, 1) Sleep($9_MINS) Next
  11. Any ideas why this would fail with no reaction? No error, log system or application logs. I'm logged on with a domain admin account. This is the line that fails even if I run it by itself Run("C:\Program Files (x86)\McAfee\Common Framework\FrmInst.exe /FORCEUNINSTALL") Ideally, the actual full script would be something like this. I tested with msgbox's and the version checker and msgbox works fine up to the line before the Run command, but I can't get the command to actually run. I tested running a notepad file that I moved to the same Common Framework directory and it ran without error. It's the FrmInst.exe that won't run. Any help or suggestions would be great. We've got about 300 machines with McAfee's 4.0 agent installed and I need to get them up to speed with our other machines. If @OSArch = "x64" Then $MCAFEE_AGENT_VER = FileGetVersion("C:\Program Files (x86)\McAfee\Common Framework\FrmInst.exe", "ProductVersion") If $MCAFEE_AGENT_VER < 4.9 Then 'MsgBox(0,'','64 BIT START AGENT UNINSTALL') Run("C:\Program Files (x86)\McAfee\Common Framework\FrmInst.exe /FORCEUNINSTALL") EndIf Else $MCAFEE_AGENT_VER = FileGetVersion("C:\Program Files\McAfee\Common Framework\FrmInst.exe", "ProductVersion") If $MCAFEE_AGENT_VER < 4.9 Then 'MsgBox(0,'','32 BIT START AGENT UNINSTALL') Run("C:\Program Files\McAfee\Common Framework\FrmInst.exe /FORCEUNINSTALL") EndIf EndIf If @OSArch = "x64" AND FileExists("C:\Program Files (x86)\McAfee\Common Framework\FrmInst.exe") Then MsgBox(0,'', 'UNINSTALL FAILURE') EndIf
  12. Before I reinvent some form of the wheel, is there an existing script that returns the size of directories recursively? I was just getting started with FileListToArrayRec when I thought I'd check if this was already done. I did something similar years ago with FileListToArray, but sadly, I lost that old include and the UDF is no more. Thanks for any help or suggestions!
  13. I got a longer version of the code below from AutoIT a couple years ago. Today, I stripped it down so it only translates the name. However it's doing it backwards. How can I translate names from "LAST NAME, FIRST NAME" to "USERNAME"? Example: Smith, John translated to jsmith or whatever the AD username is. I have a spreadsheet with a column containing lastname, firstname, but I can copy it to a text file to handle the reading a little easier. I just need a way to convert all the names into the usernames and then I can add them to a group. I have a VBS script to add them to the group, but it only works with usernames. Thanks! ; Change input to be at the top of the window...maybe ; Add function to click a button and open the user's logon script in Edit view ; display home drive connection #include #include #include #include Const $ADS_NAME_INITTYPE_GC = 3 Const $ADS_NAME_TYPE_NT4 = 3 Const $ADS_NAME_TYPE_1779 = 1 DIM $unlock DIM $mgrvalue DIM $mgrsplit DIM $manager DIM $mgr DIM $title DIM $pwdexpires Dim $arrLOGONSCRIPT[100] $oMyError = ObjEvent("AutoIt.Error", "ComError") $objRootDSE = ObjGet("LDAP://RootDSE") $username = InputBox("Username","Please input a username:") If @error Then MsgBox(0, 'username', 'Username does not exist or not able to communicate with ' & @LogonDomain) Else ; DNS domain name. $objTrans = ObjCreate("NameTranslate") $objTrans.Init ($ADS_NAME_INITTYPE_GC, "") $objTrans.Set ($ADS_NAME_TYPE_1779, @LogonDomain) $objTrans.Set ($ADS_NAME_TYPE_NT4, @LogonDomain & "\" & $username) $strUserDN = $objTrans.Get ($ADS_NAME_TYPE_1779) $UserObj = ObjGet("LDAP://" & $strUserDN) If @error Then MsgBox(0, 'username', 'Username does not exist or not able to communicate with ' & @LogonDomain) Else Call ("Displayinfo") EndIf EndIf $UserObj = "" $oMyError = ObjEvent("AutoIt.Error", "") ;COM Error function Func ComError() If IsObj($oMyError) Then $HexNumber = Hex($oMyError.number, 8) SetError($HexNumber) Else SetError(1) EndIf Return 0 EndFunc ;==>ComError Func Displayinfo() MsgBox(0, '', "Full name: " & $UserObj.FirstName & " " & $UserObj.LastName) EndFunc
  14. Your timing is impeccable. I'm working on a similar deployment using a 3rd party deployment tool that works best with MSI's. Budget cuts won't let me spend anything right now, but this would be a fairly basic conversion so hopefully one of the free options will suffice. Thanks!
  15. That should make it much easier. They sent me the wrong install and the correct one is far more robust so doing things this way should make it go much quicker. Signifigantly more files to register now so a For loop is the way to go ...and maybe build an array in case I need to add to this install in the future. Love AutoIT. Wish I could spend more than a few weeks a year working with it. Thanks!
  16. Hello, Assuming the files and folders are in the correct locations, is the conversion from batch to AutoIT below correct? Is it the best 'correct' option? --> Would it be wiser to fileinstall the batch file and just run it? The original batch is below the AutoIT code. I'm building this install blind. I don't have access to the app itself and the developers are out of reach for a couple days. Run(@ComSpec & " /c cd\") Run(@ComSpec & " /c cd c:\dist") Run(@ComSpec & " /c xcopy /csyi ""WINDOWS"" ""%WINDIR%\""") Run(@ComSpec & " /c pushd ""%WINDIR%\Downloaded Program Files""") Run(@ComSpec & " /c regsvr32 /s hwau.dll") Run(@ComSpec & " /c reg import hwau.reg") Run(@ComSpec & " /c reg import hwau-2.reg") Run(@ComSpec & " /c popd") Run(@ComSpec & " /c xcopy /csyi ""Program Files"" ""\Program Files\""") Run(@ComSpec & " /c pushd ""c:\Program Files\BizFlow\bin""") Run(@ComSpec & " /c for %%f in (*.ocx *.dll) do regsvr32 /s %%f") Run(@ComSpec & " /c reg import hwwih.reg") Run(@ComSpec & " /c reg import bff-1.reg") Run(@ComSpec & " /c reg import bff-2.reg") Run(@ComSpec & " /c popd") ORIGINAL BATCH Thanks for any help or suggestions. -Steve
  17. I need to send keys to a username and password prompt in an MMC pop up authentication window\dialogue. This works fine if I use RDP for example, so I know the code is good, but when I access my NetApp filers via the connection I setup in an MMC used for a bunch of other things as well, I get the username and password prompt, but AutoIT (VBS also) won't send the keys to those two fields. The code does not error when I run it in SciTE. Same thing occurs with any similar auth prompt from any other connection in the mmc. Even RDP connections that code can write to outside of the mmc will fail if I open the auth prompt from within the mmc. Just basic code attempts so far. I've tried with and without WinActivate and used the AutoIT Window info tool. Also tried with the handle found by the tool, but it never writes to the fields. WinActivate("Windows Security") Sleep(3000) Send("domain\username") ; send a username Sleep(250) Send("{TAB}") Send("EndUsersAreAwesome") ; send a password Send("{ENTER}") Maybe it's by design and can't be done, but I wanted to check in to see if anyone has come across this. Thanks!
  18. Thanks! To both of you. I commented out the wsh line and the script below does work now. Locally run anyway. It's not changing the PW when I push it, but that's a different issue to be addressed by other means. Thanks!! Dim $strComputer, $CPU, $objUser, $Wscript, $adminLocal ;, $wsh ;Get the local administrator name in case it is not already set to the standard $adminLocal = GetAdministratorName(@ComputerName) $strComputer = "." $CPU = ObjGet("WinNT://" & $strComputer & ",Computer") $objUser = $CPU.GetObject("User", $adminLocal) ;$wsh = ObjCreate("Wscript.Shell") $objUser.SetPassword ("ENTERPASSWORDHERE") $objUser.SetInfo ; Debugging ;MsgBox(0,'',$admin) Func GetAdministratorName($ComputerName) Dim $UserSID, $oWshNetwork, $oUserAccount $objWMIService = objGet( "winmgmts:{impersonationLevel=impersonate}!//" & $ComputerName & "/root/cimv2") $oUserAccounts = $objWMIService.ExecQuery("Select Name, SID from Win32_UserAccount WHERE Domain = '" & $ComputerName & "'") For $oUserAccount In $oUserAccounts If StringLeft($oUserAccount.SID, 9) = "S-1-5-21-" And _ StringRight($oUserAccount.SID, 4) = "-500" Then Return $oUserAccount.Name Endif Next EndFunc
  19. We need to change the local Admin password on our network nodes. I can use the "Net User" command inside an AutoIT script, but because of an unique setup we have here and another system we use to push things, it would be better if we could convert the VBS version into AutoIT, pack it in an exe and send with our pushing system. I've tried re-writting the code below in AutoIT and it fails. Anyone have this converted already or do you have any tips or suggestions? Dim strComputer, CPU, objuser, wsh strComputer = "." Set CPU = GetObject("WinNT://" & strComputer & ",Computer") Set objuser = CPU.GetObject("User", "Administrator") Set wsh = Wscript.CreateObject("Wscript.Shell") objUser.SetPassword "ENTER PASSWORD HERE" objUser.SetInfo The code below errors with "Variable must be of type "Object"." I'm sure the $wsh line is wrong, but don't know the answer. I'm not sure if anything else needs to be changed. Dim $strComputer, $CPU, $objUser, $wsh, $Wscript $strComputer = "." $CPU = ObjGet("WinNT://" & $strComputer & ",Computer") $objUser = $CPU.GetObject("User", "Administrator") $wsh = $Wscript.CreatObject("Wscript.Shell") $objUser.SetPassword "Password" $objUser.SetInfo Thanks for any help or suggestions!
  20. I need to delete\remove a couple certs. I've tried with CertUtil.exe and CertMgr.exe. I think CertMgr.exe would work better, but I don't know enough about certs to understand what info from the cert I should be using to call it. Can anyone provide an example of a certmgr script to delete a cert? I've been reading a lot of things like: http://msdn.microsoft.com/en-us/library/e78byta0%28VS.80%29.aspx but I just don't understand what I should be entering to call the cert. None of my attempts have worked so far. I've tried below and have switched out the name for the sha1 hash, but get pretty much the same failure each time. Error: Failed to find a certificate to delete CertMgr Failed Certmgr -del -c -n "Betrusted Production SSP CA A1" -s -r localMachine IntermediateCertificationAuthorities Any ideas are greatly appreciated. Thanks!
  21. We're on a fed campus and only have domain admin rights over our OU. Our OU has Users, Computers, OPS, etc, but we don't have access to the DC's event logs via anything other than scripts. Phooey.
  22. We have a domain admin service acct that's getting locked about every 15 minutes. Anyone know how to find out where (what machine name hopefully), the logon is failing? Thanks!
  23. Does anyone have anything that will recursively edit NTFS permissions? I've looked into xcalcs.vbs, but not getting where I need as fast as I need. Our executive office wants our Domain Admins removed and replaced with a different domain Admins group with only a select few domain Admins as members. Easy except for the past decade they've had us grant\remove permissions on many sub-folders for individuals and groups both in and out of their office. I ran a report with Hyena that shows 40 permissions per page and is 115 pages long. That's gonna take a while to manually configure. If remove the domain Admins group from the top directory and set it to "Replace permission entries on all child objects with entries shown here that apply to child objects", then it will remove "exlicitly defined permissions" on those sub\child objects. I basically need the script to permform the steps below regardless of inheritence settings: Remove 1 group from all folders\directories at all levels Add 1 group to all folders\directories at all levels Retain all current permissions for other groups and individuals - I guess if it read\stores them at the start, it can wipe them and them replace them, but that's getting into a risky area. There has to be something already created that can do this. We can be the first people who need a script to replace permissions in this manner. Any help is greatly appreciated.
  24. This is failing to overwrite the SofieAddIn.xla file. I've rewritten this trying to FileDelete, FileMove, DirDelete the whole directory and recreate, FileAttrib, but no luck. The DLL and the XLA both have the same attributes, but the dll gets overwritten no problem. Both are READ-ONLY and "File is ready for archiving" and "For fast searching, allow Indexing Service to index this file" are checked on both fiels. The return on the FileInstall for the XLA is always 0. The date and tested return date on the XLA is 2009/03/10. How can I overwrite or move or replace the XLA file? Thanks! $SofieDir = (@ProgramFilesDir & "\Sofie") $SofieAddIn = ("SofieAddIn.xla") $AspEncryptDLL = ("AspEncrypt.dll") If Not FileExists($SofieDir) Then DirCreate($SofieDir) ;AspEncrypt.dll installation If FileExists($SofieDir & "\" & $AspEncryptDLL) Then ;Check date $DLLt = FileGetTime($SofieDir & "\" & $AspEncryptDLL) $DLLyyyymd = $DLLt[0] & "/" & $DLLt[1] & "/" & $DLLt[2] If $DLLyyyymd <> "2009/5/14" Then Fileinstall("AspEncrypt.dll", $SofieDir & "\" & $AspEncryptDLL, 1) Sleep(3000) Run(@ComSpec & " /c regsvr32 /s " & $SofieDir & "\" & $AspEncryptDLL, "", @SW_HIDE) EndIf Else Fileinstall("AspEncrypt.dll", $SofieDir & "\" & $AspEncryptDLL, 1) Sleep(3000) Run(@ComSpec & " /c regsvr32 /s " & $SofieDir & "\" & $AspEncryptDLL, "", @SW_HIDE) EndIf ;SofieAddIn.xla add-in installation If FileExists($SofieDir & "\" & $SofieAddIn) Then ;Check date $t = FileGetTime($SofieDir & "\" & $SofieAddIn) $yyyymd = $t[0] & "/" & $t[1] & "/" & $t[2] If $yyyymd = "2010/5/25" Then Exit Else MsgBox(0,"", "$yyyymd = " & $yyyymd) MsgBox(0,"", "About to install " & $SofieDir & "\" & $SofieAddIn) FileSetAttrib("""C:\Program Files\Sofie\SofieAddIn.xla""", "-RA") FileDelete("""C:\Program Files\Sofie\SofieAddIn.xla""") $SofieAddInFILEINSTLL = FileInstall("SofieAddIn.xla", $SofieDir & "\SofieAddIn.xla", 1) MsgBox(0,"","$SofieAddInFILEINSTLL " & $SofieAddInFILEINSTLL) EndIf Else FileInstall("SofieAddIn.xla", $SofieDir & "\" & $SofieAddIn, 1) EndIf Sleep(5000) RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Excel\Options", "OPEN", "REG_SZ", """C:\Program Files\Sofie\SofieAddIn.xla""") RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Excel\Options", "OPEN", "REG_SZ", """C:\Program Files\Sofie\SofieAddIn.xla""")
  25. Sorry again for the delayed repy. 9 month old daughter had a 104 temp for a couple days! Yes. All is well on this front. The registry value's data gets re-ordered exactly as desired. The overall issue we're having with the product persists, but this fix has now been successfully implemented and we can cross this off the list. Thanks!!
×
×
  • Create New...