Jump to content

Problems copying between file systems?


Zizzzzy
 Share

Recommended Posts

Thanks for taking the time to read over this,

To update a large amount of computers where I work we have created a TFTP image that does several things, including placing a batch file in the startup menu to launch several updates once we log into the machine. Seeing as the patches launched by this batch file are located on network drives, a pause statement was added to the batch file to ensure that login was completed and drives were correctly mapped before allowing the updates to launch and subsequently error out. Since I have to update several hundred machines over the course of the next few weeks I wanted to create a a quick (I thought) script that could be copied localy VIA the TFTP image. It could be launched before pausing the script and would check the status of the given network drive until status was ready, then ensure window focus and send a keystroke to break the pause in the batch file.

The compiled program works 100% as intended run from a network or local location, however when I put it into the TFTP image, once copied localy when I boot back into windows it will not run. I notice when I execute it a brief increase in CPU load, however no process ever gets launched. I am able to decompile the "broken" file and the source is identical to what it needs to be. File size is identical. I do not understand why having this file copied from a TFTP image would cause it to no longer run.

TFTP is built with PC DOS and uses NTFSPRO to mount the partition for file copy.

I highly suspect there are conflicts between the PC DOS or the NTFS mounting, however if filesize and source are the same what is causing the corruption in my program? Has anybody had a similar experience?

Below is the code, the first half is for another task which scans every 5 seconds for 1 minute to look for a window that is on most systems but not all. Basic logic to the coding is that if it hasnt poped within 1 minute, its not going to pop, continue the script.. lol. The second half performs the function described above.

Tomorrow if I have time to work on it I will add msgbox's to help identify if anythign at all is hapening or if it plain doesnt run, however I ran out of time today for that. I thought it best to post tonight so that I may have some beter ideas to help troubleshoot this.

Cheers

Dim $Status
Dim $Continue=0
Dim $Counter=0

Sleep(1000)

;Waits for windows prompt to reboot after partition resize.  
;Will try for 1 Minute (12 times delayed by 5 seconds) before continuing to check Q: drive status and launch update
Do
    If WinExists("System Settings Change","") Then
        If Not WinActive("System Settings Change","") Then WinActivate("System Settings Change","")
        WinWaitActive("System Settings Change","")
        Sleep(100)
        Send("n")
        Sleep(100)
        WinActivate("C:\WINDOWS\system32\cmd.exe","") ;Focus back to batch CMD window
        $Counter=12
    Else
        Sleep(5000)
        $Counter=$Counter + 1
    EndIf
Until $Counter=12

;Waits for Q: drive to be active before launching update file
While $Continue=0
    $Status=DriveStatus( "Q:\" )
    If $Status="Ready" Then
        If Not WinActive("C:\WINDOWS\system32\cmd.exe","") Then WinActivate("C:\WINDOWS\system32\cmd.exe","")
        WinWaitActive("C:\WINDOWS\system32\cmd.exe","")
        Send("{ENTER}")
        $Continue=1
    Else
        Sleep(150)
    EndIf
WEnd
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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