RE: Query to test the existence of a folder

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Thank you for that answer.

"Sherry Kissinger [MVP-SMS]" wrote:

I could see using [...] inventorying *.exe;

I fear this wouldn't solve the problem, I'll explain later on why not.

(still would require a modification to
sms_def.mof;

Oops. This was excactly what I tried to avoid.

but to default classes, not new stuff requiring a mofcomp),
would be to have the script create a new Environment Variable, something like
CDATAFOLDER, and the value would be either True or False, as applicable.
Then of course edit sms_def.mof to enable the gathering of win32_environment
variables.

Interesting idea. I will think about it.

If you aren't comfortable with editing sms_def.mof; I'd go with the fake
.exe file. Of course, you could go the route of a custom WMI class or
regkey, then extending sms_def.mof/mini.mof ...

I thought about extending the sms_def.mof including the appropriate WMI
query "SELECT * FROM Win32_Directory WHERE Name='C:\\data'" which works fine
in CIM Studio. Unfortunately the query "SELECT * FROM Win32_Directory" ends
up in a disastrous slow down of the client computer.

but for something like this I
don't know if I would bother with a customization to that level.

The sms_def.mof already hasn't been modified to achieve this goal.


would depend upon who is going to be seeing the raw data returned. If just
me or my immediate team; I'd use the easiest method possible. If the raw
data will be used by another team or boss' a few levels up--I'd probably
professionalize it a bit more.

I think I should tell you a little more about the background: There's a lot
of software installed throughout the domain which should be removed.
Unfortunately I have little information about it. In some cases this means
just a fragment of the installation path. "Installation" means it has beeen
installed via setup.exe or a *.msi or by simply copying folders. SMS just
reported folders if an *.exe was included as you just mentioned. If the path
was e.g. "c:\Program Files\Companyname\Softwarename\System\program.exe" SMS
didn't find the path of the software product if I only told the fragment
"c:\Program Files\Companyname\Softwarename" and there were no *.exe files
included directly inside of this folder.

I'd like to have a chance to detect whether a folder exists or existed on a
client machine no matter whether it belongs to a software and no matter
whether *.exe (or any other type of) files are directly included. SMS reports
even software once installed on a client machine so it seemes the correct way
to me to do this.


Standarize. Simplify. Automate.


Of course.

"Matthew Hudson" wrote:

You would need to do this through a VBSCript since your asking to check the
entire HD for a folder by name.

I don't know how you would get the information backup to the SMS server.
create a MIF file to be inventoried with the necessary data or have it append
to a network share the information. How many systems are you looking at
doing it to ?
--
-----------------------
http://sms-hints-tricks.blogspot.com/


"Marco" wrote:

Does anyone know the SMS query to test the existence of a folder (e.g.
C:\Data) no matter whether it has subfolders or not, no matter whether files
are included or not and no matter whether if this folder is part of a
software product?

I'm sorry if this is a stupid question. I'm no SMS admin.
.



Relevant Pages

  • Re: Can I hide Program Files for better organization?
    ... Perhaps they are being used by other apps - it doesn't matter. ... antivirus program) that seem to object to being installed in a folder. ... Fortunately most installation programs allow you to ...
    (microsoft.public.windowsxp.general)
  • Re: Query to test the existence of a folder
    ... C:\Data) no matter whether it has subfolders or not, ... I'm no SMS admin. ... I disagree, yes I know you don't like me disagreeing with you, but I am disagreeing anyway:-P ... you could use the view instance provider to select only the specific folder you want to inventory. ...
    (microsoft.public.sms.misc)
  • Getting rid of outdated Site info in SMS 2.0
    ... I have a SMS 2.0 sp5 site on NT 4 domain. ... their site code still appears in the SMSLogon\Sites folder ... information is on all logon points. ... my SMS installation? ...
    (microsoft.public.sms.admin)
  • Re: Query to test the existence of a folder
    ... C:\Data) no matter whether it has subfolders or not, ... I'm no SMS admin. ... I disagree, yes I know you don't like me disagreeing with you, but I am disagreeing anyway:-P ... you could use the view instance provider to select only the specific folder you want to inventory. ...
    (microsoft.public.sms.misc)
  • Re: Please help (CLient=NO Assigned=NO)
    ... I've specified installation account and connection ... I've specified the Client ... Have you tried running the SMS client install on any of these clients? ... You're looking in the wrong folder, that's where SMS 2.0 used to live... ...
    (microsoft.public.sms.admin)