Jenko22 Posted July 6, 2007 Posted July 6, 2007 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 thiscode.txt
NetworkGeezer Posted July 6, 2007 Posted July 6, 2007 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.
webman Posted July 6, 2007 Posted July 6, 2007 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.
Jenko22 Posted July 6, 2007 Author Posted July 6, 2007 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.
Jenko22 Posted July 6, 2007 Author Posted July 6, 2007 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
NetworkGeezer Posted July 6, 2007 Posted July 6, 2007 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"
Barcrest Posted August 13, 2007 Posted August 13, 2007 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now