MSFN Forum: help by batch programming - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

help by batch programming all files execute in a directory Rate Topic: -----

#1 User is offline   Oggi 

  • Newbie
  • Group: Members
  • Posts: 16
  • Joined: 22-February 04

Posted 23 February 2004 - 03:41 PM

hello,

i have the following problem.

i have many xp update packages in a folder.

now i have a batchfile which looks like so:

start.bat
cls
@echo off

set param=%1
echo start...
start /wait %param%
echo fertig


now i want a batch file which get all files of the directory(xp-updates) and then he should start the batch like:

start.bat filename

do you now what i mean ? i will read all the filenames of a directory and send it to the batchfile which excute the file.

can someone make a little batchfile for me please ?

thanks.

mfg
Oggi :)


#2 User is offline   mdes 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 343
  • Joined: 07-November 03

  Posted 23 February 2004 - 04:04 PM

Use the DOS command FOR :) It's very powerfull (FOR/?)

#3 User is offline   Oggi 

  • Newbie
  • Group: Members
  • Posts: 16
  • Joined: 22-February 04

Posted 24 February 2004 - 05:01 AM

hmm its very hardly hmm

can you make me a simple code please ?

mfg
Oggi

#4 User is offline   mdes 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 343
  • Joined: 07-November 03

  Posted 24 February 2004 - 05:29 AM

Put the following code in a .BAT or .CMD file (.BAT=.CMD):
@ECHO OFF
FOR %%I IN (*.EXE) DO (
    ECHO Starting %%I
    START /WAIT %%I
    ECHO fertig
)


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy