Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. vb.net Shell() successful?

vb.net Shell() successful?

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharplinuxxmlhelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    partt
    wrote on last edited by
    #1

    I execute the following command, but want to see if it successfully created the xml file: cmd = "bcp ""select * from dbName..tableName where StudyNo = " & SN & """ queryout c:\tResultQue.xml -c -S servername -U uname -P pwd" Shell(cmd) I tried the following, but it won't work as it executes before the file is created: If File.Exists("c:\tResultQue.xml") Then 'success Else 'failed End If Thank you for any help!

    R 1 Reply Last reply
    0
    • P partt

      I execute the following command, but want to see if it successfully created the xml file: cmd = "bcp ""select * from dbName..tableName where StudyNo = " & SN & """ queryout c:\tResultQue.xml -c -S servername -U uname -P pwd" Shell(cmd) I tried the following, but it won't work as it executes before the file is created: If File.Exists("c:\tResultQue.xml") Then 'success Else 'failed End If Thank you for any help!

      R Offline
      R Offline
      rwestgraham
      wrote on last edited by
      #2

      Rather than using Shell, you should create a Process object to run the command. The Process class allows you to wait for a return code that signals the execution has terminated.

      P 1 Reply Last reply
      0
      • R rwestgraham

        Rather than using Shell, you should create a Process object to run the command. The Process class allows you to wait for a return code that signals the execution has terminated.

        P Offline
        P Offline
        partt
        wrote on last edited by
        #3

        Thanks!

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups