CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 11 of 11
  1. #1
    Join Date
    Nov 2000
    Location
    Israel
    Posts
    72

    execute exe file?

    hi.
    is it possible to execute exe or dll file from local htm file (using VbScript, maybe)?

    Smile, Shmulik. (-;

  2. #2
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: execute exe file?

    Option Explicit

    Dim FSO
    Dim WSH

    Const AppToRun = "C:\test.exe"

    Set WSH = WScript.CreateObject("WScript.Shell")
    Set FSO = CreateObject("Scripting.FileSystemObject")

    If FSO.FileExists(AppToRun) Then
    WSH.Run AppToRun
    Else
    MsgBox AppToRun & " Does not Exist"
    End If

    Remember to enclose long file names in Quotes





    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

  3. #3
    Join Date
    Nov 2000
    Location
    Israel
    Posts
    72

    Re: execute exe file?

    ok it's work - but...
    in this way i recieve an alart message. i do not want this message. is there another way?

    Smile, Shmulik. (-;

  4. #4
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: execute exe file?

    Are you trying to write a virus?

    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

  5. #5
    Join Date
    Nov 2000
    Location
    Israel
    Posts
    72

    Re: execute exe file?

    i knew you'll think so.
    no. i'm trying to build a local internet application (something like intranet) on my computer, that will be able to run exe files (instead start->programs, for example). i want to run it with out IIS, so i need to execute files using VbScript.
    just for remind: every thing is local. no access to the internet.

    Smile, Shmulik. (-;

  6. #6
    Join Date
    May 1999
    Posts
    87

    Re: execute exe file?

    I tried this code and got WScript undefined. Could you tell me the problem?? Thanks


  7. #7
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: execute exe file?

    Do you have WindowsScriptHost installed on your machine?

    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

  8. #8
    Join Date
    May 1999
    Posts
    87

    Re: execute exe file?

    I don't know but it would seem that I do not. Any suggestions?


  9. #9
    Join Date
    May 1999
    Posts
    87

    Re: execute exe file?

    Yes, I have WScript installed in the Windows Directory as a Host Application. What do you think, you have been very good so far and it is much appreciated. Any response to your download code, which works and now I need some upload code.
    Thanks again


  10. #10
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: execute exe file?

    Rate it if it helped you

    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

  11. #11
    Join Date
    May 1999
    Posts
    87

    Re: execute exe file?

    Yes, I do have it intalled. I'm trying to execute it from an HTM document-does that matter?


Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured