-2

I need help rendering input through 2 different VBScripts. Here's my code, but I need a way of rendering the input of A.vbs into B.vbs, here's my code:

Option Explicit
Dim Shell
Set Shell = CreateObject("WScript.Shell")
Speed = InputBox("How long do you have to wait between clicks, in seconds?", "")
Wait = InputBox("How long until this script runs?", "")
msgbox("You have " & Wait & " seconds until this script runs.")
WScript.Sleep (Wait*1000)
Shell.Run "B.vbs"

1 Answers1

-1

You can use Environment Variables:

' Create WSH Shell object
Dim objWshShell
Set objWshShell = CreateObject("WScript.Shell")

' Get the Environment
Dim objEnvironment
Set objEnvironment = objWshShell.Environment("System")

' Write to variable
objEnvironment("Speed") = Speed

' Read from variable
MsgBox objEnvironment("Speed")

You will want to write to the environment variable(s) in your A.vbs script and read from the variable(s) in your B.vbs script.

Étienne Laneville
  • 4,697
  • 5
  • 13
  • 29