Get command line from Batch file put it into VBA

tstc79tt

New Member
Joined
Dec 12, 2012
Messages
19
i have batch file that run from VBAexcel But the thing is i dont want to run batch file

i want everything on VBA . for example you use vba to cmd and then run this line of command

i have try but i just new to VBA and programing :)

how can i do it

here the code

this is from batch
Code:
@echo off
>summary.txt (
  for %%F in (*chkpackage.log) do findstr /l %1 "%%F" nul||echo %%F:N/A:N/A:N/A:N/A:N/A:N/A:N/A:N/A:N/A:N/A:N/A:N/A:N/A:N/A:N/A:N/A:N/A:N/A
)




and this is code in vba :)

Code:
FileSet = Sheet1.Range("C13")
    txtFpath = Sheet1.Range("C7").Value
    FilePath = txtFpath & "\res.bat"
     
     
     
    ChDrive "C"
    RSP = Shell(Environ$("COMSPEC"), vbNormalFocus)
    Application.Wait Now + TimeValue("00:00:01")
    SendKeys "CD " & txtFpath & "{ENTER}", True
    Application.Wait Now + TimeValue("00:00:01")
    SendKeys "start " & FilePath & " " & FileSet & "{ENTER}", True
    Application.Wait Now + TimeValue("00:00:15")
    SendKeys "exit " & "{ENTER}", True
    Application.Wait Now + TimeValue("00:00:01")
    SendKeys "exit " & "{ENTER}", True

any suggestion i have to admit that i'm really not good in programing if you can add some explaination is a great thing for me to try to study
thank you
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

Forum statistics

Threads
1,215,316
Messages
6,124,228
Members
449,149
Latest member
mwdbActuary

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top