Query Count files under Specific folder in Sccm?

Hello!
I try to create a Query in sccm. There I want to count files under a specific folder. If folder on the client have less than 35 files, show the name of that computer. How should I begin to create that Query? Should I use criteria Software files Count?
Greetings
Emil

I think for this task you will find it easier to create a report instead. Queries are based on WQL which has some limitations.
Kent Agerlund | My blogs: blog.coretech.dk/kea and
SCUG.dk/ | Twitter:
@Agerlund | Linkedin: Kent Agerlund |
Mastering ConfigMgr 2012 The Fundamentals

Similar Messages

  • To relocate mail.log, mail.log_current file to specific folder

    Hi
    We have configured CommSuite 6 in single host. The output of “imsimta version”:
    Sun Java(tm) System Messaging Server 7.0-0.04 32bit (built Jun 20 2008)
    libimta.so 7.0-0.04 32bit (built 01:01:00, Jun 20 2008)
    Using /opt/sun/comms/messaging/config/imta.cnf
    SunOS mail 5.10 Generic_120012-14 i86pc i386 i86pc
    Output of imta_tailor file:
    IMTA_USER=mailsrv
    IMTA_USER_USERNAME=nobody
    IMTA_WORLD_GROUP=mail
    IMTA_LOG=/logs/messaging/imta
    IMTA_PRIMARY_LOG=/logs/messaging/imta/mail.log_current
    IMTA_SECONDARY_LOG=/logs/messaging/imta/mail.log_yesterday
    IMTA_TERTIARY_LOG=/logs/messaging/imta/mail.log
    We need to relocate mail.log, mail.log_current, mail.log_yesterday file to specific folder.
    After above setting we cannot be able to relocate above file.
    Pl. help us.
    Thanks
    P.K.

    world.group wrote:
    We have configured CommSuite 6 in single host. The output of “imsimta version”:Please note that CommSuite 6 update 1 is now available and it is advisable that you upgrade using the "commpkg upgrade" command.
    IMTA_LOG=/logs/messaging/imta
    IMTA_PRIMARY_LOG=/logs/messaging/imta/mail.log_current
    IMTA_SECONDARY_LOG=/logs/messaging/imta/mail.log_yesterday
    IMTA_TERTIARY_LOG=/logs/messaging/imta/mail.logThese parameters are now ignored as per the Messaging Server 7.0 release notes:
    http://wikis.sun.com/display/CommSuite6/Messaging+Server+7.0+Release+Notes#MessagingServer7.0ReleaseNotes-Ignoredimtatailorsettings
    We need to relocate mail.log, mail.log_current, mail.log_yesterday file to specific folder. You can relocate the MTA log directory through the use of symlinks.
    Regards,
    Shane.

  • How to count files in a folder and subfolders of the folder.

    Hello everyone,
    I'm having a difficulty with countin files in a Regular folder and subfolders of the folder. I've tried to use SI_ANCESTOR  in a query; however, it gives me innacurate results.
    I used this hierarchy to create the code below, and it works to count all the files:
    Folder A ---> Folder B( subFolder of A)  -
    > Folder C(subFolder of B)  
    //get folder A
    IInfoObjects regFolders = infoStore.query ("SELECT * FROM CI_INFOOBJECTS WHERE SI_KIND='Folder' AND SI_PARENTID=0 AND SI_NAME!='User Folders' Order by SI_NAME");
    IFolder regFolder = (IFolder) regFolders.get(0);     
    //get files from Folder A     
    IInfoObjects rFiles = infoStore.query ("SELECT * FROM CI_INFOOBJECTS WHERE SI_PROGID !   = 'CrystalEnterprise.Folder'   AND SI_PARENTID=" + regFolder.getID() );
    ilesCount += rFiles.size();
    int subCntr=0;
    nt subCntr2=0;
      //get folder B      
    IInfoObjects rSubFolders = infoStore.query ("SELECT * FROM CI_INFOOBJECTS WHERE SI_PROGID = 'CrystalEnterprise.Folder' AND SI_PARENTID=" + regFolder.getID() );
    //get files from subFolders of Folder A
    while (subCntr < rSubFolders.size())
              IInfoObject subFolder=(IInfoObject)rSubFolders.get(subCntr);
              IInfoObjects subFiles = infoStore.query ("SELECT * FROM CI_INFOOBJECTS "
          + " WHERE SI_PROGID != 'CrystalEnterprise.Folder'" AND SI_PARENTID=" + subFolder.getID() );
             filesCount += subFiles.size();
             //get subFolders of Folder B                   
             IInfoObjects rSubFolders2 = infoStore.query ("SELECT * FROM CI_INFOOBJECTS WHERE SI_PROGID = 'CrystalEnterprise.Folder' AND SI_PARENTID=" + subFolder.getID() );
                         //get files from subFolders of Folder B
         while (subCntr2 < rSubFolders2.size())
              IInfoObject subFolder2=(IInfoObject)rSubFolders2.get(subCntr2);
              IInfoObjects subFiles2 = infoStore.query ("SELECT * FROM CI_INFOOBJECTS "
                   + " WHERE SI_PROGID != 'CrystalEnterprise.Folder'  AND SI_PARENTID=" + subFolder2.getID() );
                                               filesCount += subFiles2.size();
               subCntr2++;
              subCntr++;
    As you can see, the code is too complicated, and what if folder C has subFolder?
    I'm guessin maybe recursion would be one way to got, but I'm not really good with it, so I was wondering if anyone has any idea on how to go about doing it.
    Thank you,

    Hi,
    For detailed information, please refer to the BI 4.0 developers guide here.
    You can find the section "Setting up the development environment" in developers guide that have every single instruction to execute a java code specific to BI 4.0 environment.
    Also, here are the instructions for BO 3.1 environment:
    To configure a WAR file for a J2EE application that uses the BusinessObjects Enterprise XI 3.0 and 3.1 Java SDK, complete these steps:
    Create a lib folder in the WAR file's WEB-INF folder.
    Copy the Enterprise XI 3.0 or 3.1 Java SDK JAR files from the appropriate location below to the WAR file's WEB-INF\lib folder:
    Windows:
    ...\Program Files\Business Objects\common\4.0\java\lib
    UNIX:
    <businessobjects_root>/java/lib
    Copy the log4j.jar file from the appropriate location below to the WAR file's WEB-INF\lib folder:
    Windows:
    ...\Program Files\Business Objects\common\4.0\java\lib\external
    UNIX:
    <businessobjects_root>/java/lib/external
    Copy the entire crystalreportviewers12 folder from the appropriate location below to the WAR file's root folder.
    Windows:
    ...\Program Files\Business Objects\common\4.0
    UNIX:
    <businessobjects_root>/enterprise12/JavaSDK
    Open the web.xml file located in the WAR file's WEB-INF folder.
    Specify the location of the utility files used by the report viewers contained in the crystalreportviewers12 folder by inserting the following code below the <display-name> and <description> tags but within the <webapp> tag definition:
    <context-param>
    <param-name>crystal_image_uri</param-name>
    <param-value>/BOXIR3/crystalreportviewers12</param-value>
    </context-param>
    <servlet>
    <servlet-name>CrystalReportViewerServlet</servlet-name>
    <servlet-class>com.crystaldecisions.report.web.viewer.CrystalReportViewerServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>CrystalReportViewerServlet</servlet-name>
    <url-pattern>/CrystalReportViewerHandler</url-pattern>
    </servlet-mapping>
    Deploy the WAR file to the J2EE application server.
    You are now able to run an application using the BusinessObjects Enterprise XI 3.0 and 3.1 Java SDK on a J2EE web application server.
    Hope it helps.
    Regards,
    Anchal

  • Counting files in a folder and showing results in an alert window.

    Hello all.
    I would like to get the script to count the number of files in a selected folder.
    I have a UI where there are browse, ok and cancel buttons.
    I wanted the OK button to show the number of jpeg files in the selected folder. If no folder is selected, and the OK button is pressed, it would prompt the user to select a folder before pressing the OK button.
    Thanks!

    all you need to learn scripting is in the "JavaScript Tools Guide", you're making some progress but reading that and following the samples will make things clear and speed the learning proccess up.
    if you look at your code there's only one function, it is called when the Browse button is clicked. See how it is constructed and write another similar function for the Ok button, in there read the contents of the label box and create a folder with that path, then call the function to read the files.
    dlg.Panel1.okBtn.onClick = function (){
       selectedFolder = new Folder(decodeURI(dlg.Panel1.Path.text));
       if (selectedFolder.exists)
            doSomething (selectedFolder);
       else
            alert("select a folder first...");
    dlg.center(); //center dialog box on screen
    dlg.show(); //show dialog box
    function doSomething(folder)
            files = folder.getFiles();
            alert(files.length + " Files in selected Folder");
            alert(files);

  • Service file under template folder missing

    Hai,
    We have installed ITS 6.2 in  a machine.  The templates folder of AGATE does not have service files like BWSP, PZ transaction.
    I think after installation standard service files should be in templates folder. Correct me if i am wrong.  Is there any procedure for the Basis team to publish the all the service after installation. .
    Please let me know what is the procedure(or configuration) which basis has to do to publish all service files provided by SAP.
    Thanks & Regards,
    H.K.Hayath Basha.

    Hai,
    We have another ITS 6.2 server also in which the templates for the service files are under templates folder for example:
    D:\Program Files\SAP\ITS\Development\Template
    Under this templates we have folders with name BWSP, PZ01, PZ02...
    We have another new installation of ITS 6.2 patch 26 in another machine, the folder structure is
    D:\Program Files\SAP\ITS\Development\Template
    Under this template folder I am not able to see folders like BWSP, PZ01, PZ02.
    I am development consultant, in the previous installation I don't know what Basis did to publish the templates for BWSP, PZ01 and PZ02 under the path,
    D:\Program Files\SAP\ITS\Development\Template
    In the new installation my Basis team member doesn't know what the earlier team member has done to publish the templates for service files.
    Please let me know what is the procedure to publish the service file as templates in ITS server.
    Thanks & Regards,
    H.K.Hayath Basha.
    Service files in the templates folder? For sure, you can make this, but
    I would recommend to use the correct folder. The structure of the ITS folders
    has not been changed, as far as I know.
    Another good idea: Read the documentation or use your preferred search method
    for finding files like webgui.srvc

  • Auto unzip files under downloads folder

    - any downloaded files will go to "downloads folder" on the dock.
    - any "zip" type of files will unzip(decompress) on it's own under "downloads folder" right after the download action is completed.
    my question:
    1. is it safe for the zip file to unzip by itself? will I somehow get virus this way?
    (if there are any virus in the zip file).
    2. is there any way to turn this auto unzip feature off?
    (note that: it only unzips on it's own under "downloads folder" on the dock right after download is completed.)

    1. This shouldn't be a problem, but you can never be too safe.
    2. If you are downloading your files using Safari, do the following:
    Safari > Preferences... > General (Tab) > Open "safe" files after downloading (Uncheck)

  • How to create file in specific folder...

    Hi developers,
    I am new to java. I would like to create file in some folder. But i am fail to create it. Can any body help me please..
    This is my code. It creates folder well...But file doesn't create.
    import java.io.*;
    public class file1
         public static void main(String ar[])
              File f = new File("c:\\ram");
              f.mkdirs();
              String pat = f.getAbsolutePath();
              File ffs = new File("c:\\ram.txt");
              System.out.println(pat);
    }With Regards
    sure...:)-

    Also, it's not clear where you want the file.
    You're making a directory C :\ram, but then you're talking about a file ram.txt that's right in C:
    Also, you can use / instead of doubling up the \ and it wil get converted properly.
    If I wanted to create a file C:\ram\ram.txt I'd do this:
    File parentDir = new File("C:/ram");
    File file = new File(parentDir, "ram.txt");
    parentDir.mkdirs();
    file.createNewFile();

  • Downloading file in specific folder not possible

    When I use the standard Settings in FF901 (Win7 64bit home premium) under "General" downloading files to the standard folder c:\user\username\downloads - there is no problem. When I choose "ask every time where to download" the downlaod box closes, I can' t choose a download folder and the file ends up in c:\user\username\appdata\local\temp as e.g. AXiXgx4C.exe.part". I checked this file,it's fully downloaded and after deleting "part" it works. I tried suggestions like "disable virus scanning in Firefox preferences" and disabling the virus protection of NOD but it didn't help. Only help was restarting Win7, but then after a while I ran into to the same problem again.
    What to do?

    Thank you for your reply. I searched in different forums and obviously this problem is known among firefox users. A simple but effective solution was to deinstall Firefox completely and also delete the profiles folder and profiles.ini. I also deleted temp files and remaining mozilla folders.
    Now after a clean reinstall everything works again.

  • How to count files in a folder

    Hello!
    I have a folder with .txt files. If the file name is STRING i need to count all .txt files whose file names contain "STRING".
    For example, if there are STRING.txt, STRING1.txt,STRING2.txt.... in the folder, i need to find out how many of .txt files are there, where substr(filename,0,6)='STRING'
    How can i do this?
    Cheers
    A.

    if it's windows, then this will count the files
    for /f "usebackq tokens=1,2" %i in ( `dir STRING` ) do if '%j'=='File(s)' set file_cnt=%i
    [pre]
    the variable "file_cnt" will have the answer. 
    or the "set" command above could just be an "echo". 
    and of course, in order to do this from pl/sql, you'll need java. 
    you could even change the "set" to an "exit", and the
    file count will be returned as the exit status.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Read info about files in specific folder into internal table

    Hi Experts
    I need to have last modified date and filename information read into an internal table. I need to read in the information of all files in a specific (UNIX) folder (I do not know the name of the single files).
    I really hope someone can help.
    Thanks a lot
    Kind regards,
    Torben

    Hi Guys
    Thanks a lot for you input.
    I managed to get my program to works as follows:
    REPORT  ZDELETE_ARCHIVING_FILES.
    *Step 1: Get the list of files in the directory into internal table :
    DATA: DLIST    LIKE EPSFILI OCCURS 0 WITH HEADER LINE,
          DPATH    LIKE EPSF-EPSDIRNAM,
          MDATE    LIKE SY-DATUM,
          MTIME    LIKE SY-UZEIT.
    DATA: BEGIN OF FATTR OCCURS 0,
              FILE_NAME  LIKE EPSF-EPSFILNAM,
              FILE_SIZE  LIKE EPSF-EPSFILSIZ,
              FILE_OWNER LIKE EPSF-EPSFILOWN,
              FILE_MODE  LIKE EPSF-EPSFILMOD,
              FILE_TYPE  LIKE EPSF-EPSFILTYP,
              FILE_MTIME(12),
          END OF FATTR.
    DATA: P_PATH(50) TYPE C.
    CONCATENATE '/ARCHIVE/' sy-sysid '/archive' INTO P_PATH.
    *        WRITE: / P_PATH.
    DPATH = P_PATH.
    *Get files in folder - read into internal table DLIST
    *if filenames are longer than 40 characters
    *then use FM SUBST_GET_FILE_LIST.
    CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
         EXPORTING
              DIR_NAME               = DPATH
         TABLES
              DIR_LIST               = DLIST
         EXCEPTIONS
              INVALID_EPS_SUBDIR     = 1
              SAPGPARAM_FAILED       = 2
              BUILD_DIRECTORY_FAILED = 3
              NO_AUTHORIZATION       = 4
              READ_DIRECTORY_FAILED  = 5
              TOO_MANY_READ_ERRORS   = 6
              EMPTY_DIRECTORY_LIST   = 7
              OTHERS                 = 8.
    IF SY-SUBRC EQ 0.
    *Step 2: Read the file attributes into an internal table
    *Read info about the files (attributes) into the internal table FATTR
    *as we need info about the last time it was changed (MTIME)
      LOOP AT DLIST.
        CALL FUNCTION 'EPS_GET_FILE_ATTRIBUTES'
             EXPORTING
                  FILE_NAME              = DLIST-NAME
                  DIR_NAME               = DPATH
             IMPORTING
                  FILE_SIZE              = FATTR-FILE_SIZE
                  FILE_OWNER             = FATTR-FILE_OWNER
                  FILE_MODE              = FATTR-FILE_MODE
                  FILE_TYPE              = FATTR-FILE_TYPE
                  FILE_MTIME             = FATTR-FILE_MTIME
             EXCEPTIONS
                  READ_DIRECTORY_FAILED  = 1
                  READ_ATTRIBUTES_FAILED = 2
                  OTHERS                 = 3.
        IF SY-SUBRC EQ 0.
          FATTR-FILE_NAME = DLIST-NAME.
          APPEND FATTR.
        ENDIF.
      ENDLOOP.
      SORT FATTR BY FILE_NAME.
      DATA: time(10), date LIKE sy-datum.
      DATA: months TYPE i.
      DATA: e_file TYPE string.
      LOOP AT FATTR.
      CLEAR: time, months, e_file.
        IF FATTR-FILE_NAME(10) = 'archive_BW'.
    *Convert the unix time into readable time
          PERFORM p6_to_date_time_tz(rstr0400) USING FATTR-FILE_MTIME
                                                     time
                                                     date.
    *Calculate the number of months between date (MTIME) and current day
    *ex 31.03.2009 - 01.04.2009 = 1 month
    *ex 01.02.2009 - 01.04.2009 = 2 month
        CALL FUNCTION 'MONTHS_BETWEEN_TWO_DATES'
          EXPORTING
            i_datum_von = date
            i_datum_bis = sy-datum
          IMPORTING
            e_monate = months.
            CONCATENATE DPATH '/' FATTR-FILE_NAME INTO e_file.
    *        WRITE: / FATTR-FILE_NAME,
    *                 FATTR-FILE_SIZE,
    *                 date,
    *                 time,
    *                 sy-datum,
    *                 months,
    *                 e_file.
    *Step 3: Delete files where months > 1
          IF months > 1.
            OPEN dataset e_file for output in text mode encoding default.
            DELETE dataset e_file.
            CLOSE dataset e_file.
          ENDIF. "months > 1
        ENDIF.
      ENDLOOP.
    ENDIF.

  • How to make the Installer place support files in specific folder

    Hi,
    I'm trying to use the LabVIEW2009 installer for the first time. I haven't used any earlier ones, so my understanding is limited. I have created a project and an executable and wish to direct the installer to place some groups of files in a number of directories other than the one in which the executable goes. On the Source Files page I can see a number of Folder descriptions in square brackets. I don't understand how to use these. Are they to be set up to point to specific directories? If so how?
    So far I have managed to create an installer which puts all the support files from the project in a single directory. My attempts to select a subset of files within the Project View window and place them in a separate directory were not allowed since they are treated as an indivisible group. Basically i don't know enough about the installer and my searches for information have only yielded very basic information.
    If anyone can help by supplying or pointing to more detailed information I'd be most grateful.
    Thanks
    George
    Solved!
    Go to Solution.

    Hi George
    This is from the LV help:
    Destination View—Specifies the location and directory structure of the files when they are installed. Select an item from the Project View tree and click the arrow button or drag the file to the Destination View tree to include it in the installer directory structure. You can drag multiple files at the same time. Click the buttons below the Destination View tree to add, remove, and rename folders in the directory. You also can right-click the folders and select a command from the shortcut menu.
    The folders in the Destination View directory that do not have an LV prefix correspond to Microsoft Installer (MSI) properties that install files in the following locations.
    [CommonAppDataFolder]—Files you include in this folder install to the Application Data folder.
    [CommonFilesFolder]—Files you include in this folder install to the Common Files folder.
    [DesktopFolder]—Files you include in this folder install to the Windows desktop of the current Windows user.
    [LVxxRTEDIR]—Where xx is the LabVIEW version currently in use. Files you include in this folder install to the folder of the Run-Time Engine for the LabVIEW version currently in use.
    [LVDIR]—Files you include in this folder install to the folder of the LabVIEW version currently in use.
    You can find a full list of the MSI properties here. Scroll down to "System Folder Properties"
    Best Regards
    David

  • How  to read all files  under a folder directory in FTP site

    Hi Experts,
    I use this SQL to read data from a file in FTP site. utl_file.fopen('ORALOAD', file_name,'r');
    But this need to fixed file name in a directory. However, client generate output file with auto finename.
    SO do we have any way to read all file by utl_file.fopen('ORALOAD', file_name,'r');
    We need to read all file info. because client claim for security issue and does not to overwirte output file name,
    we must find a way to read all file in output directory.
    Thanks for help!!!
    Jim

    If you use Chris Poole's XUTL_FTL package, I believe that contains functions that allows you to query the directory contents.
    http://www.chrispoole.co.uk/apps/xutlftp.htm
    Edited by: BluShadow on Jan 13, 2009 1:54 PM
    misread the original post

  • Count files in a folder

    I want to count the files in a volume. This will tell me how many pictures that i have then as certain actions happen it will automatically add them up for me. First step is finding the corect syntax for the items.

    The problem with the above methods is that they could be counting folders/text/exe files etc.
    You can control what you want to count with something like this...
    app.document.deselectAll();
    alert(app.document.getSelection("jpg,pdf,tif").length);
    The above will only count jpg, pdf and tif files.

  • Files under each child folder

    hi all,
    i want to write a program which will list all files under each folder in the structure e.g
    c:\1xml\1.html
    c:\1xml\hello\hello.java
    c:\1xml\hello\hi\file.xml
    etc
    following codes only shows me one level.
    can any one hint me to resolve this issue?
    String dirName = "C:\\1xml";File dir = new File(dirName);System.out.println(dir.getAbsolutePath());if(!dir.isDirectory()) {      System.out.println("File: " + dir.getName() + " is not a valid directory" );} else {      File[] allFiles = dir.listFiles(); for (int i = 0; i < allFiles.length; i++) {      String s = allFiles[i].getName(); System.out.println("File: " + s + " found");}

    i have put the code tag..can u help?
    thanks,
    /s
    c:\1xml\1.html
    c:\1xml\hello\hello.java
    c:\1xml\hello\hi\file.xml
    etc
    following codes only shows me one level.
    can any one hint me to resolve this issue?
    <pre>
    String dirName = "C:\\1xml";File dir = new File(dirName);System.out.println(dir.getAbsolutePath());if(!dir.isDirectory()) { System.out.println("File: " + dir.getName() + " is not a valid directory" );} else { File[] allFiles = dir.listFiles(); for (int i = 0; i < allFiles.length; i++) { String s = allFiles.getName(); System.out.println("File: " + s + " found");}
    </pre>

  • How to read a file on specific  Directory

    How to read a specific file on specific folder ,
    For ex , in D: contain lot of directory ,
    Let as assume �program �- Directory.
    �xxx.txt�-file,
    How to read �xxx.txt� file from program Directory,
    Give me simple pgm ,

    pradeep.rajadurai wrote:
    How to read a specific file on specific folder ,
    For ex , in D: contain lot of directory ,
    Let as assume �program �- Directory.
    �xxx.txt�-file,
    How to read �xxx.txt� file from program Directory,
    Give me simple pgm ,
    Scanner scan = new Scanner(new File("D:/program/xxx.txt"));
    // your code here[http://java.sun.com/j2se/1.5.0/docs/api/java/util/Scanner.html]

Maybe you are looking for

  • Entitlement - One user cannot see a specific portlet

    How do I entitle portlet A so that all users in Group 1 can see it, except for user ABC. User ABC is a part of Group 1, but should not see portlet A, whereas all other users of Group 1 can see portlet A. Thanks Regards, Kunal

  • Cannot drop undo tablespace

    Hello: I've created a new undo tablespace undotbs2. I've set it to the default undo tablespace. When I've tried to drop the old one, I get the following error: SQL> conn / as sysdba Connected. SQL> DROP TABLESPACE undotbs1 INCLUDING CONTENTS AND DATA

  • Broken hyperlinks after mailing

    Trying to email a PDF with hyperlinks (converted PowerPoint document) that won't break. I've selected every relevant check box as applicable (Attach source file, Add Links, etc.) in Conversion Settings. Even tried creating a folder on receiver's desk

  • Unable to move mp3 to iphone 4s

    I am no longer able to upload/move mp3 songs into my iphone 4s. "Get Info" section no longer allows me to change/rename nor add lyrics or pics to the songs. Please help...

  • Strange Error - Compiling, but no changes show up...

    I've compiled my client/server application more than a dozen times - removed it in its entirety on tomcat and on netscape and ie, but STILL, when I make changes to the source and compile, the change will NOT show up... ? SOME changes will show up to