473,397 Members | 1,961 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

using wscript to call vbscript file but...

Expand|Select|Wrap|Line Numbers
  1. Dim oShell, a
  2. oShell = CreateObject("Wscript.Shell")
  3. a = "c:\sig.vbs"
  4. 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?
Apr 25 '06 #1
3 28128
Yes, You can pass your arguments in this way
Dim oShell, a
oShell = CreateObject("Wscript.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
Sep 20 '06 #2
emp
32
Yes, You can pass your arguments in this way
Dim oShell, a
oShell = CreateObject("Wscript.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
Nov 9 '06 #3
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?
Jan 17 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Alex Ang | last post by:
I have written the following VBScript program. It is stored into a file "map_drive.vbs". It successfully mapped to a network drive \\server1\data. Dim WshNetwork Set WshNetwork =...
7
by: NewbieJon | last post by:
I am attempting to send the variable "sComputerName" from my ActiveX script to "GetInfo.asp" using javascript. (Having been advised this is the way to get my ActiveX variable into my ASP script) ...
14
by: Mark C. | last post by:
I'm trying to call a batch file that I've built using the FileSystemObject and CreateObject("Wscript.Shell"), oShell.Run... in an asp script. Naturally, I can get the script to work from a command...
11
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
1
by: Daniele | last post by:
How is it possible to call the WScript object? I haven't found it in any namespace... is it only for VBScript? If yes, is it possible to launch a .vbs programmatically from c#? Thanks, Daniele
2
by: Mike John | last post by:
I am trying to use the shell object to send keys to the explorer browser to run the send page funcion. I am receiving the above error only when I put my html file in the web server...
4
by: korund | last post by:
Is there any difference to read & write to windows Registry with VBScript or JavaScript? Both scripting languages have similar syntax. What is preferable use for this? thanks.
2
by: AbdulBaari | last post by:
Dear all, can anyone solve this problem. Im beginner in VBScript.Im getting an errorregarding "Wscript" means whenever I use WScript object, it shows Errors as " Object required: WScript" &...
5
by: meenu_susi | last post by:
hi all Could you please help me out i creating folder using vbscript.. I have used the following code... <SCRIPT LANGUAGE="VBScript"> <!-- Option Explicit
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.