#136651 - 2005-03-29 04:22 PM
Script to output list of exe's in a given directory
|
AndyK
Fresh Scripter
Registered: 2005-03-29
Posts: 8
|
Hi, Forgive me if this is a daft question. I have had absolutely no experience of scripting at all. A bit of background into what I am trying to acheive. We run an application and there are regular updates to the exe's that the users run. Unfortunately the process requires the users to kick off the upgrade process. Clearly not all users do!! I want to be able to run a script at login to check what exes exist in the install folder of the users PC. The version is reflected in the name, so I only need to output the username, pc name and the exe's into a text document.
Please help!
Many Thanks
Andy
|
|
Top
|
|
|
|
#136653 - 2005-03-29 04:32 PM
Re: Script to output list of exe's in a given directory
|
Bryce
KiX Supporter
   
Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
|
here is a UDF DirPlus() that should help.
Code:
$files = dirplus("c:\install folder","/a-d /f exe")
for each $file in $files ? $file.name next
|
|
Top
|
|
|
|
#136656 - 2005-03-29 04:39 PM
Re: Script to output list of exe's in a given directory
|
AndyK
Fresh Scripter
Registered: 2005-03-29
Posts: 8
|
Hi, Thanks to you all for the quick responses. Les, about 60 computers max. All exes live in c:\program files\ifs applications exe's needed to be logged HumanR*.exe Maketostock*.exe Distribution*.exe Financials*.exe The results ideally need to be added to 1 (or multiple) text file on a share.
Bryce - is there any way of adding the info returned into a text file on a given share?
Thanks again
|
|
Top
|
|
|
|
#136659 - 2005-03-29 05:43 PM
Re: Script to output list of exe's in a given directory
|
AndyK
Fresh Scripter
Registered: 2005-03-29
Posts: 8
|
The shell statement works great. Although it executes to whateven directory the kix script is in. Is there anyway to point the command to the program files directory on the client?
Thanks
|
|
Top
|
|
|
|
#136662 - 2005-03-29 06:17 PM
Re: Script to output list of exe's in a given directory
|
Bryce
KiX Supporter
   
Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
|
Quote:
The shell statement works great. Although it executes to whateven directory the kix script is in. Is there anyway to point the command to the program files directory on the client?
Thanks
this should create a file \\server\share\exelog.ini
Code:
Call 'g:\kix\udf\dirplus\dirplus2.kix'
$files = Dirplus("c:\program files\ifs applications","/a-d /t exe") For Each $file In $files $ = WriteProfileString('\\server\share\EXElog.ini',@USERID,$file.name,$file.datelastmodified) Next
and should have a format like this.
Code:
[ billsmith ] file1.exe = 3/24/2004 11:45 am file2.exe = 3/24/2004 11:45 am file3.exe = 3/24/2004 11:45 am
[ bob ] file1.exe = 3/24/2004 11:45 am file2.exe = 3/24/2004 11:45 am file3.exe = 3/24/2004 11:45 am
|
|
Top
|
|
|
|
#136663 - 2005-03-29 06:32 PM
Re: Script to output list of exe's in a given directory
|
AndyK
Fresh Scripter
Registered: 2005-03-29
Posts: 8
|
Hi Bryce, This looks promising. Although I don't understand the first line. The dirplus2.kix, is that the file from the link you posted in your first message??
Thanks for the effort you are putting in.
Andy
|
|
Top
|
|
|
|
#136664 - 2005-03-29 06:47 PM
Re: Script to output list of exe's in a given directory
|
Bryce
KiX Supporter
   
Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
|
Quote:
Hi Bryce, This looks promising. Although I don't understand the first line. The dirplus2.kix, is that the file from the link you posted in your first message??
Thanks for the effort you are putting in.
Andy
Oops that call statment is just to the location that i keep a lot of my UDF's, and in this case DIRPlus() is located in that file.
|
|
Top
|
|
|
|
#136668 - 2005-03-30 12:12 PM
Re: Script to output list of exe's in a given directory
|
Anonymous
Anonymous
Unregistered
|
Thanks guys, got exactly what I wanted. Jens, unfortunately the update cannot be done remotely as different sites and people need different updates. So to do it per user is the best way really.
Thanks Again
Andy
|
|
Top
|
|
|
|
#136669 - 2005-03-30 01:40 PM
Re: Script to output list of exe's in a given directory
|
Anonymous
Anonymous
Unregistered
|
Hi again, Works well on my PC, but when I try to get it working as a login script it comes up with the following error:
ERROR : expected expression! Line : 4
Line 4 is: $files = Dirplus("c:\program files\ifs applications","/a-d /f exe") Is this to do with it not looking at the clients c:? Any ideas?
Thanks
Andy
|
|
Top
|
|
|
|
#136670 - 2005-03-30 01:46 PM
Re: Script to output list of exe's in a given directory
|
Anonymous
Anonymous
Unregistered
|
Just found the problem, Was using @lserver instead of @LDRIVE in the script
Ta!
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 871 anonymous users online.
|
|
|