Jump to content

batch select setup from NEWEST directory


Recommended Posts


Hello,

i have directory structure like this

6.1.99

6.1.100

6.1.101

6.1.102

and so on

i want to execute command setup.exe /QN1 on the newest directory (or directory with newest version number). Do you know how to do it?

In your directory tree you have one single file wich is named setup.exe?

Link to comment
Share on other sites

Who's created the directory structure? Can you correct their names so the they are numbered correctly? Were the directories created on different dates according to your needs? Do the setup files have dates which can be used instead? etc.

Link to comment
Share on other sites

In other words, this is the output of

DIR | FIND "<DIR>"

with a "right" numbering:

W:\test>dir | FIND "<DIR>"

14/02/2008 18.47 <DIR> .

14/02/2008 18.47 <DIR> ..

14/02/2008 18.45 <DIR> 6.1.099

14/02/2008 18.45 <DIR> 6.1.100

14/02/2008 18.46 <DIR> 6.1.101

and this is the output of the same command with "your" numbering:

W:\test>dir | FIND "<DIR>"

14/02/2008 18.50 <DIR> .

14/02/2008 18.50 <DIR> ..

14/02/2008 18.45 <DIR> 6.1.100

14/02/2008 18.46 <DIR> 6.1.101

14/02/2008 18.45 <DIR> 6.1.99

;)

jaclaz

Edited by jaclaz
Link to comment
Share on other sites

However without renaming the directory:

dir/ad/od/b

will return

W:\test>dir/ad/od/b

6.1.99

6.1.100

6.1.101

6.1.102

by sorting according to date/time (oldest first).

You could then parse the output to use the latest directory.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...