Re: script variable to batch file

Tech-Archive recommends: Speed Up your PC by fixing your registry



"Daniel" <Daniel@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:28FB1FC1-616B-456D-9096-E06E491656BD@xxxxxxxxxxxxxxxx
> How can I transfer a dim set in a script to a batch file that is executed
by
> this script.
>
> In my script I set a variable named "strPath", then I execute a bat file
> name "CreateMsg.bat". However, for this batch file to work properly I
need
> it to have access to the strPath value. How can this be achieved?
>
> Thanks,
>
> Daniel

Pass it as a parameter.

Option Explicit
Const cBAT
cBAT = "CreateMsg.bat"
Dim strPath
strPath = "whatever"
Dim strRUN
strRUN = "%comspec% /c " & cBAT & " " & strPath
Dim objWSS
Set objWSS = CreateObject("WScript.Shell")
objWSS.Run strRUN, 0, True
Set objWSS = Nothing


.



Relevant Pages

  • Re: How to have Outlook create folder if folder is not present?
    ... the above script in my current O2K installation. ... plus a question re the library in References that I can't find. ... Dim objCurrentItem As Outlook.MailItem ... Dim strPath As String ...
    (microsoft.public.outlook.program_vba)
  • Re: Should my design be changed??
    ... This is kinda like a batch file but is vbscript. ... The script then opens the file. ... >> Dim fso 'to be used for file related code ... >> Duane Hookom ...
    (microsoft.public.access.tablesdbdesign)
  • Need help Comparing File Date with System Date
    ... I must do a script that checks if a file in the "c:\trackitaudit.id" exists. ... If not a batch file is called "audit.bat". ... Dim oFile ... 'Create FileSystemObject object to access the file system ...
    (microsoft.public.windows.server.general)
  • Need help Comparing File Date with System Date
    ... I must do a script that checks if a file in the "c:\trackitaudit.id" exists. ... If not a batch file is called "audit.bat". ... Dim oFile ... 'Create FileSystemObject object to access the file system ...
    (microsoft.public.scripting.wsh)
  • Need help Comparing File Date with System Date
    ... I must do a script that checks if a file in the "c:\trackitaudit.id" exists. ... If not a batch file is called "audit.bat". ... Dim oFile ... 'Create FileSystemObject object to access the file system ...
    (microsoft.public.scripting.vbscript)