Posted 28 March 2006 - 19:00
I am in the process of, and almost completed with, the creation of a utility that will allow you to punch in the UNC path, the target EXE name, specify any command line arguments to be used (ie /noeula, /unattend:t2, etc) and the credentials(domain or local) for autopatcher to be ran as.
This is in response to my problem of running Autopatcher from a network share with a higher level (administrator) of access than what the user that will be logged into the computer has. I was going to use batch file to accomplish this, but it ended up that I needed like 3 batch files to get the job done. That wouldn't have been that bad, I guess, but then you have to factor in that a batch file is basically a plain text document and if I'm going to be using this method my password would need to be piped in somehow, most likely in plain text. Some of you might come back with the argument to use CPAU because you can encode a file and then run that file..I just don't like that method, I want to keep everything simple and just have 1 EXE file that is involved with invoking Autopatcher. So after exhausting several different methods I decided to just write the EXE myself.
In case anyone wants to know how the EXE utility works here goes:
A gui will pop up asking you for the following information(defaults given in parenthesis):
UNC Path (blank)
Autopatcher EXE: (autopatcher.exe)
command line arguments: This is not an open edit box; instead there are checkboxes for /noeula and /noreboot, etc and then a drop down for unattend:t1/unattend:t2/unattend:t3. All command line arguments listed on this forum will be available.
Credentials:Username (username), Domain (blank=local computer), and Password.
After all that information is supplied then there is a 'create EXE' button, which after pressing will give you a prompt of where to save the resulting EXE . Pressing the create button does the following:
Takes all your data and creates a temp file (located in same dir as utility) and then compiles that as an EXE in the place you have chosen, then deletes the temp file.
The actual process of "running" the autopatcher.exe (or whatever target EXE you input) will be done with the following lines (which will be created from your created EXE file)
autopatcher.exe /noeula /unattend:t2 (or whatever command line options you choose)
All of that will be run under the credentials you specify.
One thing concerning the compiled EXE: The end result compiled exe (which you create by hitting 'create EXE' is not heavily encoded and could be compromised if someone had the capability to de-compile the exe and grab it out. Of course it is still MUCH more secure than a plain text batch file. In my company this is not a problem, I actually probably would have been safe with a batch file since most users are not very Knowledgeable of programming and the like.
I will make this utility available here when finished if anyone is interested in it. If you have any other questions or ideas let me know by making a reply post. I hope more than myself will find this utility useful.