Alastair,

  The WScript.Shell object is a COM object wrapper for the ShellExecute API, 
which you can call directly from RBase using the DLCall function.   The 
parameters argument for ShellExecute is where you would put your comma 
separated values (or whatever separator the executable is expecting).  Another 
thing, since RBase uses single quotes, and these APIs expect double quotes, it 
takes the work out of the quote business.  This is guaranteed to be silent and 
zippier, since there is no COM overhead.

--Begin code
{
ShellExecute.rmd example by Mike Byerley
}
{

The Windows API declaration of Shellexecute:

HINSTANCE ShellExecute(          HWND hwnd,
    LPCTSTR lpOperation,
    LPCTSTR lpFile,
    LPCTSTR lpParameters,
    LPCTSTR lpDirectory,
    INT nShowCmd
);
Syntax located at:
http://msdn.microsoft.com/en-us/library/bb762153(VS.85).aspx

}
SET VAR nShowCmd Integer = 0  { SW_HIDE }
SET VAR lpDirectory TEXT = NULL
SET VAR lpParameters TEXT = NULL
SET VAR lpFile TEXT = 'TestBat.bat'
SET VAR lpOperation TEXT = 'open'
SET VAR HWND Integer = 0 { since it runs hidden, pass HWND as null }

SET VAR vRetVal Integer = NULL

IF (chkfunc('ShellExecuteA')) = 0 THEN
  STDCALL function 'ShellExecuteA' ALIAS 'ShellExecute' +
  (Integer, ptr TEXT (256), ptr TEXT (128), +
  ptr TEXT (128), ptr TEXT (32), Integer) : Integer
ENDIF

SET VAR vi = (dlcall('shell32.dll', 'ShellExecuteA', +
nShowCmd, lpDirectory, lpParameters, lpFile, lpOperation, HWND))

RETURN

--End code






----- Original Message ----- 
From: "Alastair Burr" <[EMAIL PROTECTED]>
To: "RBASE-L Mailing List" <[email protected]>
Sent: Tuesday, August 05, 2008 6:06 PM
Subject: [RBASE-L] - Re: Silent LAUNCH command.


Many thanks, Larry.

I had already tried the double quotes and even found something on the internet 
that used double double quotes but had no luck with it.

>From your first response I'll try a new version of my InvisibleDOS.VBS file

CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & 
WScript.Arguments(1)& WScript.Arguments(2)"""", 0, False

and play with that to see if I can make it work somehow - at least that gives 
me something to work on.

Again, thanks,
Regards,
Alastair.

  ----- Original Message ----- 
  From: Lawrence Lustig
  To: RBASE-L Mailing List
  Sent: Tuesday, August 05, 2008 9:35 PM
  Subject: [RBASE-L] - Re: Silent LAUNCH command.


  Additionally, if your problem is that the batch file is getting executed 
_without_ the parameters, the problem is the script is being passed three 
parameters, but uses only the first as the command line to execute.

  You may be able to fix this by passing the entire command line in quote 
characters:

  LAUNCH InvisibleDOS.VBS|"C:\DosPrograms\Attrib.BAT I: -R|W"

  And, depending on your own quote settings, you may need to surround the whole 
launch string in quotes and/or double up your double quotes.
  --
  Larry


No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.138 / Virus Database: 270.5.12/1592 - Release Date: 05/08/2008 
06:03

--- RBASE-L
================================================
TO POST A MESSAGE TO ALL MEMBERS:
Send a plain text email to [email protected]

(Don't use any of these words as your Subject:
INTRO, SUBSCRIBE, UNSUBSCRIBE, SEARCH,
REMOVE, SUSPEND, RESUME, DIGEST, RESEND, HELP)
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: INTRO
================================================
TO UNSUBSCRIBE: 
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: UNSUBSCRIBE
================================================
TO SEARCH ARCHIVES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: SEARCH-n
(where n is the number of days). In the message body, 
place any 
text to search for.
================================================


Reply via email to