IWS7.1 @ WinCE6.0: start application on button action

Hi all,

I am working on a IWS7.1 project which is running on a Beckhoff CX5010 CPU with Windows CE embedded 6.0. On one of the IWS pages I need to implement a button which starts and focus a third party program (.exe) on Windows CE.

On the IWS page I included a button with a on-Down action of type VBScript and the following command:
$WinExec("\hard disk\ftp\Recipe\Recipe.exe")

The $WinExec command is working in Windows CE as long as the path to the program does not contain any spaces. In the example above a space is present in the "hard disk" part. Unfortunately I am forced to use this folder because the files in the main root folder "/" are non persistant. Also, am not able to change the name of the "hard disk" to for e.g. "harddisk".
In the full path the use of double quotes or escape chars are also not accepted by IWS.

Is there any other solution that I can use to startup a program located in the "/hard disk" through a button on a IWS page?

PS using the Beckhoff "startMan" application present on Windows CE I was able to create a keyboard shortcut "CTRL-R" which starts the Recipe.exe program. Any idea if there is a solution to send this key combination to the OS by an IWS button action?

If anything is unclear please let me know. Thanks in Advance.
- Peter
  • Hi Peter.

    Indusoft does have some functions for sending control characters etc. to screens (SendKeyObject, AppSendKeys) which may be worth investigating.

    However, use of WinExec may still be possible if CE Embedded has the standard Windows 'cmd' functionality. 'cmd' also doesn't like spaces in command strings, but this can be managed with quoting. For example on my PC the console command:

    cmd /c Xmas 2012\2012 Xmas.xls

    doesn't work, whereas:

    cmd /c "Xmas 2012\2012 Xmas 2012.xls"

    does open the spreadsheet 'Xmas 2012.xls' in the folder 'Xmas 2012'.

    So ... if you can construct a command string tag containing quotes as:

    cmdtag = cmd /c "\hard disk\ftp\Recipe\Recipe.exe"

    then:

    WinExec(cmdtag)

    should do the trick. I think quotes can be placed in string tags ok, possibly using double quoting??

    Regards,
    Greg Shearer
  • Hi Shearer,

    Thanks for your reply and advice. The "SendKeyObject" and "AppSendKeys" functions are unfortunately not available on Windows CE or an IWS Windows CE project.

    Also the use of double quotes or escape chars are not allowed in button action field in the IWS project.

    For now I found a workaround by copying the recipe files to the root directory "/" every time the PLC is started using "StartMan" and a batch script. From within IWS I assigned "$WinExec("\Recipe.exe")" to the button action. This workaround seems to work correctly.

    Ofcourse, if there is any easier solution please let me know!