If I remember correctly (50/50 chance here),
I think batch files accept parameters as %1%, %2%,
and so on, so if you change %A% in your batch file
to %1%, it should work.
You can run your batch file yourself by
bringing up a cmd window, navigating
to the folder where your batch file it,
and then running it. This would help clarify
if the problem is with the batch file or the
VB code.
Robin S.
----------------------------
"Ahmad Sabry" <(E-Mail Removed)> wrote in message
news:%23QPW%235$(E-Mail Removed)...
> it works now but not 100%
> i mean it opens the CMD prompt
> but i think the problem in the way i pass the variable (A)
> to the batch file
> my Code is:
> ========================================
> Dim A As String
> A = TextBox1.Text
> Dim p As New System.Diagnostics.Process
> With p
> With p.StartInfo
> .FileName = "C:\Doit.bat"
> .Arguments = A
> End With
> .Start()
> .WaitForExit()
> End With
> ========================================
> & my batch file:
> ========================================
> @ECHO OFF
> mkdir c:\%A%
> ========================================
> So ... where is the mistake ?
>
|