| 1. |
Solve : batch for run all bat files? |
|
Answer» I have to try to run all batch files under folder subfolder wih one batch This will launch each batch file in that folder: here nothing happendsAre your batch files in this folder: D:\myfloder\Drivers\conf Quote from: Squashman on April 25, 2014, 01:26:26 PM Are your batch files in this folder: D:\myfloder\Drivers\conf no there must be batch which runs all batch files batch files are under D:\myfloder\Drivers\conf\MIKE\archive\bat but all folders are diferend because are from differend usernames, this one is for MIKE. and there is 30 users and 30 folders which have 30 batch files which needs to be runned Quote from: Blisk on April 25, 2014, 01:36:28 PM no there must be batch which runs all batch filesThen you got your first code example COMPLETELY BACKWARDS as your code is looking for all the batch files in that folder. D:\myfloder\Drivers\conf\)Hmm, If there are 30 users how are we doing to know which one is logged in for the correct directory path? Quote from: Squashman on April 25, 2014, 01:51:27 PM Hmm, this is runned on server and I need to run this batch files Code: [Select]echo off pushd "..\logfiles" for /f "delims=" %%a in ('dir /b /od /a-d ') do set "lastest_file=%%a" copy "%lastest_file%" "..\test\new" popd"Runned is not a word." Does your browser not have spell check. Nor does your reply answer my question. Quote from: Squashman on April 25, 2014, 01:56:30 PM "Runned is not a word." Don't know what you mean with user logged on? Because it is not relevant for this batch files. We need to search copy.bat files in subfolders D:\myfloder\Drivers\conf and after that script will find copy.bat under D:\myfloder\Drivers\conf\MIKE\archive\bat D:\myfloder\Drivers\conf\JOE\archive\bat D:\myfloder\Drivers\conf\NIKE\archive\bat and it will run that copy.bat files So you SAID 30 folders with 30 batch files. That is 900 batch files. You really want to execute 900 batch files?I have no idea what you are trying to accomplish. But this is my take on it. Code: [Select]for /d %%G in (D:\myfloder\Drivers\conf\*) do ( FOR %%H in ("%%G\archive\bat\*.bat") do call "%%H" ) |
|