samedi 28 mars 2015

how to run and modify a cmd script or file in c




@echo off

set "yourDir=C:\Users\asus\Desktop"

echo:List only files:
for %%a in ("%yourDir%\*") do echo %%~fa

echo:List only directories:
for /d %%a in ("%yourDir%\*") do echo %%~fa

echo:List directories and files in one command:
for /f "usebackq tokens=*" %%a in (`dir /b "%yourDir%\*"`) do echo %yourDir%\%%~a

pause


i have a cmd script and i want to include and run it in a c script


and if possible modify it (the cmd script contains variables ).


do you have a solution ?




Aucun commentaire:

Enregistrer un commentaire