Results 1 to 14 of 14

Thread: Running Exe on remote Computer

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2004
    Location
    India
    Posts
    56

    Question Running Exe on remote Computer

    Dear All

    I have a VB Exe and I want to run it on a remote pc just sitting at my place.
    this remote PC is connected to my laptop via LAN.
    How can I do it?
    Its Urgent...

    Thanks in advance...

    Nahush.

  2. #2
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Running Exe on remote Computer

    Use your IP address, and select the program

    VB Code:
    1. SHELL "\\192.168.0.1\MyApp.exe"

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

    Re: Running Exe on remote Computer

    You say run it on remote system and not from so that means that you can
    not just run the network shortcut because it will actually be running from you
    system and not the remote system.

    I had this issue before and I got around it by creating my exe as a service. I
    also wrote a service installer so I could install it remotely and then run the
    service remotely. Because its a service it will run ON the remote system as
    long as you set the "SERVICE_INTERACTIVE_PROCESS" flag.

    Its allot of APIs. There is another way, you can use the task scheduler, but
    you need to set it up on the remote console. Then it will run on a schedule.
    Easier but no control of starting, stopping, installing, or uninstalling.
    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

  4. #4
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Running Exe on remote Computer

    oh, that's right. well, you woud have to schedule it in the task scheduler, or set it up to run when you logged on to the other machine.

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

    Re: Running Exe on remote Computer

    Not quite. If you use task scheduler, set it up on the console of the remote
    system (logging into the remote systems desktop using Remote Desktop,
    Citrix, or Terminal Server) and set up the schedule for the process.

    If you use the service route then it can run without being logged on since it
    may be a server and you can have it set so it will "allow service to interact
    with the desktop" and log on using "local system account". This will ensure
    that the service will run without you being logged on. It will run under the
    local system account, basically act as part of the operating system.

    HTH
    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

  6. #6
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Running Exe on remote Computer

    I meant to schedule the task from the remote computer, as it woudn't run there otherwise. If you had the app run when you logged on to the remote computer, then you could have what you want.

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

    Re: Running Exe on remote Computer

    Quote Originally Posted by RobDog888
    Its allot of APIs. There is another way, you can use the task scheduler, but
    you need to set it up on the remote console. Then it will run on a schedule.
    Easier but no control of starting, stopping, installing, or uninstalling.
    But isnt that what I posted earlier.
    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
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Running Exe on remote Computer

    I guess so. I forgot about exe's running on the local machine, and was thinking of options.

  9. #9
    Hyperactive Member
    Join Date
    Sep 2002
    Location
    Okinawa, Japan
    Posts
    271

    Re: Running Exe on remote Computer

    nahush,
    No need to write installers, services, etc etc etc. Just use WMI.
    If its 2k or above you can use WMI. Not sure if WMI is on anything lower than 2k.
    For an example look at my vbscript example for installing patches. It would be the same thing doing it in vb. Just need to add the appropriate control to the project.
    http://www.vbforums.com/showthread.php?t=311633

    packetvb

  10. #10
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Running Exe on remote Computer

    another option may be to use remote desk top or, what i use, real vnc
    to control the remote machine and be able to run a program there, i can install most software etc on any machine in my lan sitting at my computer using it's cd rom

    rgds pete

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

    Re: Running Exe on remote Computer

    I also use Real VNC over a secure VPN. But I like Remote Desktop better if it is a Server system.
    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

  12. #12
    Frenzied Member pnish's Avatar
    Join Date
    Aug 2002
    Location
    Tassie, Oz
    Posts
    1,918

    Re: Running Exe on remote Computer

    There's a freeware tool available from SysInternals that will run a program remotely.

    http://www.sysinternals.com/ntw2k/freeware/psexec.shtml

    I imagine you could shell to this from a VB program.
    Pete

    No trees were harmed in the making of this post, however a large number of electrons were greatly inconvenienced.

  13. #13
    New Member
    Join Date
    Jun 2005
    Posts
    3

    Re: Running Exe on remote Computer

    I think the Creating a service and copying the file to remote system and then starting the service is the best way to get this done without letting the remote user know that anything has happened to the system. I am in network and system automations for part 4 years and using this method for remote file execution this is the best way. even if you want you can uninstall the service after the work is done.

  14. #14
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Running Exe on remote Computer

    Shell the AT command. I'm not quite sure about its syntax. You'll have to google

    Pradeep
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

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