Jump to content

Recommended Posts

Posted

A brief background;

We are running an RM CC3 network and have a directory containing an .ini relevant to each machine on the network with a line for each .msi allocated and its installation status (i.e. Installed,Install_pending,install_failed)

 

When an install fails it needs to be deleted from the .ini so the machine can retry the install on the next reboot, searching and deleting every install_failed from these files can be time consuming if there is a problem.

 

I spent a morning in visual basic trying to automate it a bit and made some progress but am now hoping someone with more knowledge can help. I have four command buttons which

- create a list box with every .ini from a specified directory.

- read the contents of an .ini file into a separate list box

- search that list box for any line containing INSTALL_FAILED and remove it

- saves the modified list box back to the .ini

 

This works to an extent but obviously requires you to press 3 buttons for every .ini file. Could anyone help me streamline this to run through every file with one click.

 

I've attached the code if anyone thinks they can help, sorry for the length of this

code.txt

Posted

Why not try the following at the command line:

 FOR /R %f IN  (*.ini) DO  type "%f" | find /V "INSTALL_FAILED" > "%f"

 

 

The only problem is that it will process every INI but it saves a bit of typing.

Posted
Why not try the following at the command line:

 FOR /R %f IN  (*.ini) DO  type "%f" | find /V "INSTALL_FAILED" > "%f"

 

 

The only problem is that it will process every INI but it saves a bit of typing.

 

Just tested this on a copy of some of the files just seems to empty the file. Cant quite get my head around what its doing so not sure where its going wrong.

Posted
Hi,

 

We run a CC3 network as well and we find that Package Log Monitor is pretty good. We also have a program by N Bentley called Package Analyser which is a bit more advanced but we can't remember where we got it from.

 

Thanks for those i had a look at Package Log Monitor and also managed to track down Package Analyser which is exactly what we're looking for.

 

For anyone else who's interested

Package Analyser Monitor

Posted

Just tested this on a copy of some of the files just seems to empty the file. Cant quite get my head around what its doing so not sure where its going wrong.

 

The FOR /R %f in (*.INI) recurisivley finds every instance of an INI file and assigns its path to the variable %f

 

The type command just reads the file pointed to by %f

 

The /V switch to the find command displays every line not containing the search string (in this case "INSTALL_FAILED" ) and hence removes it.

 

The last part was to pipe (write) it back to the original file but it looks like the shell may still be reading the ini file when we try to write back to it.

 

I have changed the code to use a temp file

 FOR /R %f IN  (*.ini) DO  type "%f" | find /V "INSTALL_FAILED" > some_temp_file.txt & move /Y some_temp_file.txt "%f"

  • 1 month later...
Posted

I did it by pointing a file list box to the correct UNC path and setting it's mask to be *.ini Then i just went through the file list box reading each ini file and checking it. You can get the filenames using a for next loop as it is basically just a list box....

 

Hope that was some help.

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



×
×
  • Create New...