using wscript to call vbscript file but...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • spikeypaul
    New Member
    • Apr 2006
    • 1

    using wscript to call vbscript file but...

    Code:
    Dim oShell, a
    oShell = CreateObject("Wscript.Shell")
    a = "c:\sig.vbs"
    oShell.run(a, 3, True)
    I am using the code above to run a vbscript, however, I have yet to find a way to pass 2 variables to the vbscript. Can this be done at all? From a vb windows application to a vbscript?
  • khillawi
    New Member
    • Sep 2006
    • 1

    #2
    Yes, You can pass your arguments in this way
    Dim oShell, a
    oShell = CreateObject("W script.Shell")
    a = "c:\sig.vbs "
    a=a & " " & arg1 & " " & arg2
    oShell.run(a, 3, True)

    Hope that will be what you want
    Regards
    Mohammed Al-Eqabi

    Comment

    • emp
      New Member
      • Nov 2006
      • 32

      #3
      Originally posted by khillawi
      Yes, You can pass your arguments in this way
      Dim oShell, a
      oShell = CreateObject("W script.Shell")
      a = "c:\sig.vbs "
      a=a & " " & arg1 & " " & arg2
      oShell.run(a, 3, True)

      Hope that will be what you want
      Regards
      Mohammed Al-Eqabi



      Will this code work in VB6.
      I try to use it directly with myfilename substituted for sig.vbs and get a syntax error on oShell.run(a, 3, True)

      I have a number of .vbs scripts that I want to execute from button presses on a VB6 GUI.

      emp

      Comment

      • roopy40
        New Member
        • Jan 2007
        • 1

        #4
        I'm trying to do the same thing. Run a vb script from an access 2003 database application. Won't work with the code provided. Should it?

        Comment

        Working...