Here is batch file 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 here is the code in VBA Excel calling the batch file:
FileSet = Sheet1.Range("C13")
txtFpath = Sheet1.Range("C7").Value
FilePath = txtFpath & "\res.bat"
ChDrive "D"
RSP = Shell(Environ$("COMSPEC"), vbNormalFocus)
Application.Wait Now + TimeValue("00:00:03")
SendKeys "CD " & txtFpath & "{ENTER}", True
Application.Wait Now + TimeValue("00:00:03")
SendKeys "start " & FilePath & " " & FileSet & "{ENTER}", True
Application.Wait Now + TimeValue("00:00:03")
SendKeys "exit " & "{ENTER}", True
Application.Wait Now + TimeValue("00:00:03")
SendKeys "exit " & "{ENTER}", True
But I don't want to use a batch file. I want to change it into command to use on VBA. So i can use only VBA and run command line instead of using VBA to call batch and command line.
Easy explanation is I want to put that command in batch file into Excel-VBA and run it by using VBA call cmd
and auto input that command to cmd
like that Sendkeys
code.