PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
ShellExecute Does not work in Win2k-VBForums
Results 1 to 19 of 19

Thread: ShellExecute Does not work in Win2k

  1. #1

    Thread Starter
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Question ShellExecute Does not work in Win2k

    Hello

    ShellExecute Does not work in Win2k Server.

    VB Code:
    1. Dim path As String
    2. path = "c:\abc.bin"
    3. lngresult = ShellExecute(Me.hwnd, "Open", path, ByVal 0, ByVal 0, SW_SHOW)

    Ruturns 32. The file realy exist in the c driver

    I also replaced 'byval 0' using vbnullchar. same result

  2. #2
    Lively Member Agilaz's Avatar
    Join Date
    Jun 2006
    Posts
    98

    Re: ShellExecute Does not work in Win2k

    are you sure that .bin files are associated with an application on that machine? what happens when you double click abc.bin in explorer?

  3. #3

    Thread Starter
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Re: ShellExecute Does not work in Win2k

    mmm. agilaz.

    currently i am in xp. i wanto to switch to 2k to check the file association.
    Pls wait....

  4. #4

    Thread Starter
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Re: ShellExecute Does not work in Win2k

    Hai Agilaz !

    You really got the point. yah. No File association for bin. i try a text file. it realy works.

    So now what i should do to open the bin throuh code?

  5. #5
    Lively Member Agilaz's Avatar
    Join Date
    Jun 2006
    Posts
    98

    Re: ShellExecute Does not work in Win2k

    well, that depends on what kind of file this .bin is and how you would like to view/open it. what application do you use to open it on your XP system?

  6. #6

    Thread Starter
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Re: ShellExecute Does not work in Win2k

    anybody?

  7. #7

    Thread Starter
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Re: ShellExecute Does not work in Win2k

    I used to open .bin file using notepad in XP.

  8. #8
    Super Moderator Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: ShellExecute Does not work in Win2k

    Well, then associate the .bin file with Notepad.
    Joacim Andersson
    If anyone's answer has helped you, please show your appreciation by rating that answer.
    I'd rather run ScriptBrix...
    Joacim's view on stuff.

    MVP

  9. #9

    Thread Starter
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Talking Re: ShellExecute Does not work in Win2k

    Quote Originally Posted by Joacim Andersson
    Well, then associate the .bin file with Notepad.
    Hai joacim

    is this way >

    make a registry change through my program at first run.

    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\
    FileExts\.bin\OpenWithList

    value "a" set to "notepad.exe"

    Is this way correct?

  10. #10
    Lively Member Agilaz's Avatar
    Join Date
    Jun 2006
    Posts
    98

    Re: ShellExecute Does not work in Win2k

    you could view it in your own application instead. that way you don't depend on file associations. a form with a RichTextBox would probably do!?

  11. #11

    Thread Starter
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Talking Re: ShellExecute Does not work in Win2k

    Quote Originally Posted by Agilaz
    you could view it in your own application instead. that way you don't depend on file associations. a form with a RichTextBox would probably do!?
    Hai Agilaz

    thats a nice idea too.

  12. #12
    Lively Member Agilaz's Avatar
    Join Date
    Jun 2006
    Posts
    98

    Re: ShellExecute Does not work in Win2k

    does that mean the problem is solved or do you need further assistance?

  13. #13

    Thread Starter
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Exclamation Re: ShellExecute Does not work in Win2k

    Quote Originally Posted by Agilaz
    does that mean the problem is solved or do you need further assistance?
    Hai Agilaz

    It really one solution.

    but for the situation if it is better if can associate the bin with a program at the start of the program.

    actuall i am waiting for some others comments. coz jecim says to associate the file with a program.

    i am waiting for him to see how it relly don correctly.

  14. #14
    Super Moderator Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: ShellExecute Does not work in Win2k

    I wouldn't recommend you to associate that file extension with Notepad, especially not doing so every time a program starts, I hate when programs change the associations I've made. If an association should be made you should let your installation program do that instead.

    And, that is the wrong key to create an association.
    Joacim Andersson
    If anyone's answer has helped you, please show your appreciation by rating that answer.
    I'd rather run ScriptBrix...
    Joacim's view on stuff.

    MVP

  15. #15

    Thread Starter
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Talking Re: ShellExecute Does not work in Win2k

    Quote Originally Posted by Joacim Andersson
    I wouldn't recommend you to associate that file extension with Notepad, especially not doing so every time a program starts, I hate when programs change the associations I've made. If an association should be made you should let your installation program do that instead.

    And, that is the wrong key to create an association.
    Hai Joacim. thank you very much for the explanation. i though i would be the key. I am using innosetup5 and hope there should be an option for this. if there is ... Great !!!

    I ll come back after checking the innosetup bit later...

    Thank you.

  16. #16
    Super Moderator Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: ShellExecute Does not work in Win2k

    Joacim Andersson
    If anyone's answer has helped you, please show your appreciation by rating that answer.
    I'd rather run ScriptBrix...
    Joacim's view on stuff.

    MVP

  17. #17
    Lively Member Agilaz's Avatar
    Join Date
    Jun 2006
    Posts
    98

    Re: ShellExecute Does not work in Win2k

    BTW...you can use ShellExecute to open the file with notepad even without file associations.

    VB Code:
    1. lngresult = ShellExecute(Me.hwnd, vbnullstring, pathToNotepad, path, ByVal 0, SW_SHOW)

  18. #18

    Thread Starter
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Re: ShellExecute Does not work in Win2k

    Thank you very much Joacim for the link.
    coz i was searching the built in inno setup help help and did not find yet.

    Thank yo Agilaz and Jacim for the support.

  19. #19
    Lively Member Agilaz's Avatar
    Join Date
    Jun 2006
    Posts
    98

    Re: ShellExecute Does not work in Win2k

    no problem

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width