Announcement

Collapse
No announcement yet.

Getting answer from vb-script with DOS bat files

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Getting answer from vb-script with DOS bat files

    Hi. I was wondering if you could use a bat file to call an external vb-script and get the answer. If so, how? I want the answer to be private, so no writing to files.

  • #2
    Re: Getting answer form vb-script with DOS bat files

    Originally posted by flytothemoon View Post
    Hi. I was wondering if you could use a bat file to call an external vb-script and get the answer. If so, how? I want the answer to be private, so no writing to files.
    No you need a TEMP-file. It can be deleted afterwards by the same batch.
    see Passing string from .vbs to .bat

    Or maybe there are 3rd party dos-tools around (where I don't know of) that allows you to Set, Read and Erase the clipboard in the DOS environment.


    \Rems
    Last edited by Rems; 8th June 2010, 19:15.

    This posting is provided "AS IS" with no warranties, and confers no rights.

    __________________

    ** Remember to give credit where credit's due **
    and leave Reputation Points for meaningful posts

    Comment


    • #3
      Re: Getting answer from vb-script with DOS bat files

      Oh. Sorry. I did not see that one. If it is deleted, does it go to a folder, or permanently delete? (I am using the rd command)

      Comment


      • #4
        Re: Getting answer from vb-script with DOS bat files

        Originally posted by flytothemoon View Post
        If it is deleted, does it go to a folder, or permanently delete? (I am using the rd command)
        The rd command deletes a directory (aka folder). Use del (or erase, same thing) to delete files. When you delete a file or directory from command line, it is not sent to recycle bin. There are ways to undelete files.

        If you are concerned about security, why not convert the entire script into VBScript or Powershell? Oh, and you can prompt user input to a batch script via set /a.

        -vP

        Comment


        • #5
          Re: Getting answer from vb-script with DOS bat files

          Hi. I was wondering if you could use a bat file to call an external vb-script and get the answer. If so, how? I want the answer to be private, so no writing to files.


          You can use windows biterscripting to get the output from the vbscript as follows.



          Code:
           
          var string output
          system "C:/path/to/script.vbs" > $output
          if ($output == "YES")
              # Do something.
              echo "something"
          else
              # Do something else.
              echo "something else"
          endif


          Can try by downloading from http: //www .biterscripting .com.
          Last edited by Rems; 29th June 2010, 18:26. Reason: live url removed by mod

          Comment

          Working...
          X