dcsimg
Results 1 to 4 of 4
  1. #1

    Thread Starter
    New Member
    Join Date
    May 2012
    Posts
    8

    How do I program my VB.net program to run an exe on a device connected to my PC?

    I have a VB.net program that uploads 2 flat files onto a scanner device that is connected to the user's PC. Now I want to have my VB.net program run an EXE on this scanner device after the flat files are uploaded. Is this possible? Please advise.

    My code currently checks that the device is connected, checks that the folder in the device exists, then uploads all flat files found on my reader file list:

    Code:
            dev = mgr.Devices.FirstConnectedDevice
            If dev Is Nothing Then
                End
            End If
    
            Try
                RemoteDirectory.CreateDirectory(dev, "\Application\modified")
            Catch
                End
            End Try
    
            While (readerfile.Peek() <> -1)
                Try
                    line = readerfile.ReadLine()
                    commaLoc = InStr(line, ",")
                    filePathIn = Mid(line, 1, commaLoc - 1)
                    filePathOut = Mid(line, commaLoc + 1)
    
                    RemoteFile.CopyFileToDevice(dev, filePathIn, filePathOut, True)
                Catch
                    End
                End Try
            End While

  2. #2
    Hyperactive Member Arve K.'s Avatar
    Join Date
    Sep 2008
    Location
    Kyrksæterøra, Norway
    Posts
    466

    Re: How do I program my VB.net program to run an exe on a device connected to my PC?

    Honestly, I have no idea what you are talking about, but the documentation for the Process.Start method should probably be fitting for the 'run an exe' part.
    Arve K.

    Please mark your thread as resolved and add reputation to those who helped you solve your problem
    Disclaimer: I am not a professional programmer

  3. #3
    Fanatic Member
    Join Date
    Dec 2014
    Location
    VB6 dinosaur land
    Posts
    833

    Re: How do I program my VB.net program to run an exe on a device connected to my PC?

    I'd think it would only possible if the scanner provides an API exposing that kind of functionality.

  4. #4
    Bad man! ident's Avatar
    Join Date
    Mar 2009
    Location
    Cambridge
    Posts
    5,054

    Re: How do I program my VB.net program to run an exe on a device connected to my PC?

    Off topic, do not ever use End. Notto mention it has no place in visual basic. It' a classic visual basic leftover.

Tags for this Thread

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


×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.