Condividi tramite


DUA Sample Script Commands

The following sample script commands can be created in a text editor and then compiled by using the Device Update Agent script compiler. Samples are provided with and without named constants.

  • Use CREATEDIRECTORY to create the directories c:\DaTest1 and c:\DaTest2 by using the following commands:

    4,0,,c:\DaTest1
    4,0,,c:\DaTest2
    

    The following commands show named constants:

    CREATEDIRECTORY,DAERH_ABORT,,c:\DaTest1
    CREATEDIRECTORY,DAERH_ABORT,,c:\DaTest2
    
  • Use REMOVEDIRECTORY to remove the directory c:\DaTest1 by using the following command:

    5,0,,C:\DaTest1
    

    The following command shows named constants:

    REMOVEDIRECTORY,DAERH_ABORT,,C:\DaTest1
    
  • Use HTTPGET to initiate an HTTP transfer of the file update.dll from a Web server.

    16,,,servername.domain.com,,duapoll/update.dll,,c:\dua\update\update.dll,,,,,DAHTTPS
    

    Note   When you use HTTPS, the servername listed in the Device Update Script must be identical to the servername listed in the certificate authorization. Use the fully qualified domain name of the server when you use HTTPS.

  • Use COPYFILE to copy the file c:\windows\system32\notepad.exe to c:\notepad.exe, and copy the file c:\windows\system32\calc.exe to c:\calc.exe by using the following commands:

    7,0,,c:\windows\system32\notepad.exe,,c:\notepad.exe,1
    7,0,,c:\windows\system32\calc.exe,,c:\calc.exe,1
    

    The following commands show named constants:

    COPYFILE,DAERH_ABORT,,c:\windows\system32\notepad.exe,,c:\notepad.exe,1
    COPYFILE,DAERH_ABORT,,c:\windows\system32\calc.exe,,c:\calc.exe,1
    
  • Use DELETEFILE to delete the file c:\notepad.exe by using the following command:

    8,0,,c:\notepad.exe
    

    The following command shows named constants:

    DELETEFILE,DAERH_ABORT,,c:\notepad.exe
    
  • Use EXECUTEPROCESS to execute the process c:\calc.exe by using the following command:

    15,0,0,,c:\calc.exe,,,0
    

    **Note   **This command is identical to any of the following commands that use [Optional] settings.

    15,0,0,,c:\calc.exe,,,
    15,0,0,,c:\calc.exe,,
    15,0,0,,c:\calc.exe,
    15,0,0,,c:\calc.exe
    

    The following command shows named constants:

    EXECUTEPROCESS,DAERH_ABORT,DANO,,c:\calc.exe,,,DANO
    
  • Use DELAY to set a system delay of 60 seconds by using the following command:

    2,0,60
    

    The following command shows named constants:

    DELAY,DAERH_ABORT,60
    
  • Use REBOOT to reboot the system using the following command:

    1,0,2
    

    The following command shows named constants:

    REBOOT,DAERH_ABORT,DAREBOOTOPT_REBOOT
    

See Also

Device Update Script

Last updated on Wednesday, October 18, 2006

© 2006 Microsoft Corporation. All rights reserved.