Results 1 to 6 of 6

Thread: Help with shell command!

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    May 2002
    Posts
    1,602

    Help with shell command!

    I have tried this code


    shell("c:\test.exe",vbNormalFocus)

    as well as:


    Dim WindowStyle As VbAppWinStyle
    WindowStyle = vbNormalFocus

    shell("c:\test.exe",WindowStyle)

    The error I recieve is that it is expecting an '='


    The last time I programmed in vb6 was 5 years ago. I have mostly programmed in .NET

    I cant figure out what I am doing wrong??

    kind regards
    Henrik

  2. #2
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Re: Help with shell command!

    It should be
    VB Code:
    1. shell "c:\test.exe",vbNormalFocus

  3. #3
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Re: Help with shell command!

    or you can use this
    VB Code:
    1. Dim ShellReturn as long
    2. ShellReturn=shell( "c:\test.exe",vbNormalFocus)
    3. 'IF the Retrun values is greater than it is the handle of
    4. 'of the opened window.It it is zero Then your shell application
    5. 'is not opend

  4. #4
    Addicted Member
    Join Date
    Jan 2006
    Posts
    234

    Re: Help with shell command!

    im unsure what your looking for,, you dont need a Vbnormalfocus on the end, Your not trying to look at the file, your trying to execute it right?

    VB Code:
    1. Shell "C:\somepath" Bang, it excutes
    2.  
    3. Shell "C:\windows\explorer.exe C:\Path" , Vbwhatever for viewing

  5. #5
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    Re: Help with shell command!

    Quote Originally Posted by danasegarane
    It should be
    VB Code:
    1. shell "c:\test.exe",vbNormalFocus
    Yup. Syntax error.

  6. #6
    Frenzied Member cssriraman's Avatar
    Join Date
    Jun 2005
    Posts
    1,465

    Re: Help with shell command!

    Do you have c:\test.exe

    or

    have you change the file name to applicable file name?

    If you are still gettin error:

    What error you are getting?
    CS

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