473,385 Members | 1,661 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,385 software developers and data experts.

Passing a Parameter to a .bat

10
Hi,
I'm trying to execute a batch file from Access using the following code:
Dim sCmd, mLoc As String

mLoc = "99999 Gravel Chev"

sCmd = "C:\Y_Drive_Cleanup\Folder.bat" + " " & mLoc & " "

Call Shell(sCmd, 1)

When I execute the module only the 99999 is passed to the batch file. I need to pass the whole string mLoc.

Can anyone help?
Oct 24 '07 #1
7 6109
Rabbit
12,516 Expert Mod 8TB
Hi,
I'm trying to execute a batch file from Access using the following code:
Dim sCmd, mLoc As String

mLoc = "99999 Gravel Chev"

sCmd = "C:\Y_Drive_Cleanup\Folder.bat" + " " & mLoc & " "

Call Shell(sCmd, 1)

When I execute the module only the 99999 is passed to the batch file. I need to pass the whole string mLoc.

Can anyone help?
Are those separate parameters? Because if it's not then you need to pass parameters with spaces by surrounding it with double quotes.
Oct 24 '07 #2
Peter99
10
Are those separate parameters? Because if it's not then you need to pass parameters with spaces by surrounding it with double quotes.

Its all 1 parameter "99999 Gravel Chev"
Oct 24 '07 #3
Rabbit
12,516 Expert Mod 8TB
Its all 1 parameter "99999 Gravel Chev"
Ok, then you need to pass parameters with spaces by surrounding it with double quotes.
Oct 24 '07 #4
Peter99
10
Ok, then you need to pass parameters with spaces by surrounding it with double quotes.
Could you give me an example. I can't get the double quotes around the parameter
Oct 24 '07 #5
Rabbit
12,516 Expert Mod 8TB
Could you give me an example. I can't get the double quotes around the parameter
Expand|Select|Wrap|Line Numbers
  1. """" & "99999 Gravel Chev" & """"
  2.  
  3. or
  4.  
  5. """99999 Gravel Chev"""
  6.  
Oct 24 '07 #6
Peter99
10
Expand|Select|Wrap|Line Numbers
  1. """" & "99999 Gravel Chev" & """"
  2.  
  3. or
  4.  
  5. """99999 Gravel Chev"""
  6.  

Thanks - It worked like a charm
Oct 24 '07 #7
Rabbit
12,516 Expert Mod 8TB
No problem, good luck.
Oct 24 '07 #8

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

Similar topics

3
by: WGW | last post by:
Though I am a novice to MS SQL server (2000 I believe), I can do almost! everything I need. Maybe not efficiently, but usefully. However, I have a problem -- a complex query problem... I can...
5
by: Andy | last post by:
Hi Could someone clarify for me the method parameter passing concept? As I understand it, if you pass a variable without the "ref" syntax then it gets passed as a copy. If you pass a...
6
by: wiredless | last post by:
What is the advantage of passing an interface type? according to UML (visio) when i reverse engineer existing code to a UML diagram I get the error "UMLE00046: sample : - An interface cannot...
11
by: John Pass | last post by:
Hi, In the attached example, I do understand that the references are not changed if an array is passed by Val. What I do not understand is the result of line 99 (If one can find this by line...
2
by: diffuser78 | last post by:
I wrote a small app in wxPython using wxGlade as designer tool. wxGlade brings and writes a lot of code by itself and thats where my confusion started. Its about parameter passing. Here is my...
10
by: amazon | last post by:
Our vender provided us a web service: 1xyztest.xsd file... ------------------------------------ postEvent PostEventRequest ------------------------------------- authetication authentication...
0
by: amazon | last post by:
I have web service that acceping following parameters.. postev.PostEvent(authentication as ws.authentication, name as string,id as string, exdate as date, parameter() as ws.nameparametervaluepair...
7
by: TS | last post by:
I was under the assumption that if you pass an object as a param to a method and inside that method this object is changed, the object will stay changed when returned from the method because the...
12
by: dave_dp | last post by:
Hi, I have just started learning C++ language.. I've read much even tried to understand the way standard says but still can't get the grasp of that concept. When parameters are passed/returned...
4
by: Deckarep | last post by:
Hello fellow C# programmers, This question is more about general practice and convention so here goes: I got into a discussion with a co-worker who insisted that as a general practice all...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.