Results 1 to 15 of 15

Thread: Shell

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2005
    Posts
    120

    Shell

    I want to write small code that run one exe using shell and exit immediately but my app wait for that exe to load before exiting I want that my app immediately exit on running that exe.
    Something like in VB.NET there is option in shell for waiting.

  2. #2
    Shared Member
    Join Date
    May 2005
    Location
    Kashmir, India
    Posts
    2,277

    Re: Shell

    What is the code that you are using? This should be more than enough.
    Code:
    Shell "notepad.exe"
    Use [code] source code here[/code] tags when you post source code.

    My Articles

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jun 2005
    Posts
    120

    Re: Shell

    yes i am using shell

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Shell

    Search the forums for "ShellAndWait" or "ShellWait".
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jun 2005
    Posts
    120

    Re: Shell

    i don't want my app to wait for that exe to load my app shoul exit as soon as shell command executed but it wait for that exe to load which takes about 6-7 secounds.
    i want somethig

    ShellAndNoWait

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

    Re: Shell

    Not sure about this problem. may be you can try creating a batch file to execute the application which takes more time to load. I know this is an indirect way. I mean
    VB Code:
    1. shell "YourBatchFile.bat"
    2. shell "Other applciation.exe"
    Here "YourBatchFile.bat" will load the application which takes more time to load.

    Not sure whether this will work for you. I don't have any application to test here. So, please test yourself
    CS

  7. #7
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Shell

    If you are waiting for it to completely load then you should use the FindWindow API to look for the window handle of your shelled apps main window.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

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

    Re: Shell

    Rob, He says his application takes more time to load. and wants to load next statement. He don't want to wait that much time.
    CS

  9. #9
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Shell

    No, I think he just wants to wait for it to load before exiting.
    my app shoul exit as soon as shell command executed but it wait for that exe to load
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  10. #10

    Thread Starter
    Lively Member
    Join Date
    Jun 2005
    Posts
    120

    Re: Shell

    no Rob i don't want to wait. i want my other statement should load without waiting but it stuck in shell command for 6-7 secs

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

    Re: Shell

    what he was saying is
    VB Code:
    1. shell "App1.exe" 'Which takes 6 to 7 seconds to load
    2. shell "Other applciation.exe"
    CS

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

    Re: Shell

    xor83, Have you tried the way I suggested in #6
    CS

  13. #13

    Thread Starter
    Lively Member
    Join Date
    Jun 2005
    Posts
    120

    Re: Shell

    I can't use batch files because that exe use some command line arguments which is like security for my app I can't expose that in batch file

  14. #14

    Thread Starter
    Lively Member
    Join Date
    Jun 2005
    Posts
    120

    Re: Shell

    BTW batch files also doing the same thing

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

    Re: Shell

    hmmmm. Can't you split this process into two different exe's. This is just try to fix your problem. I can't test it here.

    Please let us know the outcome.
    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