Jump to content

Recommended Posts

Posted

I have a script that seems to be hanging up in Win7 64 bit when I say:

DirCopy("dirtemp","C:\dirtemp",1)

This works in Windows XP just fine. One thing to note is that my desktop where I currently do scripting is XPSP3 and 32bit. So the compiled script is a 32 bit script I guess. But I don't know why that would break the DirCopy. I've disabled UAC under this account to get my scripts running...

Any ideas?

Posted

Well, it's a pretty simple script using one function from the forums:

Local $ChangeText[3] = ['', 'Now', 'Later']
$text = "This update will install Microsoft Office 2007." & @CRLF & @CRLF & "This update will install Outlook." & @CRLF & "This will only update the core Office Products: Word, Excel, and Powerpoint."& @CRLF & "Other products from Office 2003 core will be removed."& @CRLF & @CRLF & "Any other products will need to be requested via RT."& @CRLF & "Please CLOSE ALL Microsoft Office applications. This install will take between 1 and 3 hours to complete."& @CRLF & "Your computer will be slower than normal during this install. DO NOT use any office products until the install is complete."& @CRLF & @CRLF & "Your computer MAY restart at the end of the install." & @CRLF & "Questions or concerns should be addressed to the LEPP Computer Group at service-lepp@cornell.edu"
While 1
    $answer = _MsgBoxEx(4, 'Install Office 2007', $text,0,$ChangeText)
    Sleep (500)
    If $answer = 6 then 
        Sleep (500)
        ExitLoop
    Else
        Sleep (3600000)
    EndIf
    
WEnd


ProcessClose("MSACCESS.EXE")
ProcessClose("EXCEL.EXE")
ProcessClose("INFOPATH.EXE")
ProcessClose("POWERPNT.EXE")
ProcessClose("MSPUB.EXE")
ProcessClose("WINWORD.EXE")

DirRemove("C:\officetemp",1)
DirCopy("officetemp","C:\officetemp",1)
Run("C:\officetemp\setup.exe","C:\officetemp",@SW_HIDE)



Func _MsgBoxEx($iFlag, $sTitle, $sText, $iTime = 0, $sCIDChange = '')
    Local $_MsgBox_ = '"' & "ConsoleWrite(MsgBox(" & $iFlag & ', ""' & $sTitle & '"", ""' & $sText & '"", ' & $iTime & '"))'
    Local $iPID = Run(@AutoItExe & ' /AutoIt3ExecuteLine ' & $_MsgBox_, '', @SW_SHOW, 6)
    Do
        Sleep(10)
    Until WinExists($sTitle)
    If IsArray($sCIDChange) Then
        For $iCC = 1 To UBound($sCIDChange) - 1
            ControlSetText($sTitle, '', 'Button' & $iCC, $sCIDChange[$iCC])
        Next
    Else
        ControlSetText($sTitle, '', 'Button1', $sCIDChange)
    EndIf
    While ProcessExists($iPID)
        Local $iStdOut = StdoutRead($iPID)
        If Number($iStdOut) Then Return $iStdOut
        Sleep(10)
    WEnd
    If IsArray($sCIDChange) Then Return SetError(1, 0, 2)
    Return SetError(1, 0, 1)
EndFunc

I'm not sure what it would be?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...