locked
how to run any program when i connect any windows-mobile to my PC ? RRS feed

  • Question

  • hi in Windows-XP if i change this in the registry - when i connect any device (windows-mobile for example) to my PC the program that i pick (GetData.exe) will run.

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows CE Services\AutoStartOnConnect] "AutoRun"="d:\\MyTest\\GetData.exe"

     

    **but in windows-7 it dose not work**

    thanks

    Thursday, December 9, 2010 10:22 PM

Answers

  • Hi,

    I think this is due to windows vista and windows 7 got uac, uac force your program to use some mechanism called “Virtual Registry” not the real one. If you modify the registry manually, I guess it will work.

    Try to run your program with administrator previlidge to modify this value for you.

    Thanks

    Binze


    Binze Zhao [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Bin-ze Zhao Monday, December 20, 2010 2:42 AM
    Thursday, December 16, 2010 8:34 AM

All replies

  • On Thu, 9 Dec 2010 22:22:55 +0000, E_gold wrote:

    hi in Windows-XP if i change this in the registry - when i connect any device (windows-mobile for example) to my PC the program that i pick (GetData.exe) will run.

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows CE Services\AutoStartOnConnect] "AutoRun"="d:\\MyTest\\GetData.exe"

     

    *but in windows-7 it dose not work*

    I haven't dealt with Windows 7, so I don't have an answer. But I know that the alternate
    methods of having a program run when a device connects is to call CeRapiInit or
    CeRapinInitEx in the program. One of those calls "blocks" until a device connects. The
    other doesn't, so it can be used to "poll". I don't remember which is which.


    thanks

    Saturday, December 11, 2010 9:43 PM
  • Hi,

    I think this is due to windows vista and windows 7 got uac, uac force your program to use some mechanism called “Virtual Registry” not the real one. If you modify the registry manually, I guess it will work.

    Try to run your program with administrator previlidge to modify this value for you.

    Thanks

    Binze


    Binze Zhao [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Bin-ze Zhao Monday, December 20, 2010 2:42 AM
    Thursday, December 16, 2010 8:34 AM