VB Script to find the last modified file and time in a directory

Hi,
I am new to VB script i need a script to find the latest modifed file and last modifed time in a directory(Contains  folders and sub folders inside it). it has to go through all the folders and get the latest file and last modifed time.

Thanks it worked for me Get-ChildItem C:\Users\sujith.reddy.komma\Desktop\Suj1\* -recurse |?{-not $_.PsIsContainer} |Sort LastWriteTime -desc | select -first 1 now in my script i have hard coded the directory i need to run this script in different
servers from one location i will put all the different paths in one text file and ineed to pass them to this script can you help me with this?
Essentially you are incrementally asking us to write each line for you.  I recommend freeing yourself of this misery and leraning PowerShell.  THe answers to all of your questions are learned in the first few hours of study.
Start here:
http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx
¯\_(ツ)_/¯

Similar Messages

  • How to find the Last modified date and time of a package

    Hi,
    We need a clarification on how to find the Last modified date and time of a package in Oracle. We used the example below to explain our scenario,
    Lets consider the following example
    Let A, B be two packages.
    Package A calls the package B. So A is dependent on B.
    When A is compiled the TIMESTAMP,LAST_DDL_TIME in USER_OBJECTS gets updated.
    Now there a modification in package B so it is compiled. There is no modification in package A.
    Now when the package A is executed the TIMESTAMP,LAST_DDL_TIME in USER_OBJECTS gets updated but we did not make any change in Package A. Now we need to find last modified date and time of the package A . So we can not rely on the TIMESTAMP,LAST_DDL_TIME in USER_OBJECTS . Can u please tell us any other solution to get last modified date and time of the package A .
    Regards,
    Vijayanand.C

    Here is an example:
    SQL> SELECT OBJECT_NAME,CREATED,LAST_DDL_TIME,TIMESTAMP,STATUS FROM USER_OBJECTS
    2 WHERE OBJECT_NAME = ANY('A','B');
    OBJECT_NAM CREATED LAST_DDL_TIME TIMESTAMP STATUS
    A 20-MAY-2004 10:57:32 20-MAY-2004 10:57:32 2004-05-20:10:57:32 VALID
    B 20-MAY-2004 10:58:22 20-MAY-2004 10:59:04 2004-05-20:10:59:04 VALID
    SQL> CREATE OR REPLACE PROCEDURE A AS
    2 BEGIN
    3 NULL;
    4 NULL;
    5 END;
    6 /
    Procedure created.
    SQL> SELECT OBJECT_NAME,CREATED,LAST_DDL_TIME,TIMESTAMP,STATUS FROM USER_OBJECTS
    2 WHERE OBJECT_NAME = ANY('A','B');
    OBJECT_NAM CREATED LAST_DDL_TIME TIMESTAMP STATUS
    A 20-MAY-2004 10:57:32 20-MAY-2004 11:01:28 2004-05-20:11:01:28 VALID
    B 20-MAY-2004 10:58:22 20-MAY-2004 10:59:04 2004-05-20:10:59:04 INVALID
    SQL> EXEC B
    PL/SQL procedure successfully completed.
    SQL> SELECT OBJECT_NAME,CREATED,LAST_DDL_TIME,TIMESTAMP,STATUS FROM USER_OBJECTS
    2 WHERE OBJECT_NAME = ANY('A','B');
    OBJECT_NAM CREATED LAST_DDL_TIME TIMESTAMP STATUS
    A 20-MAY-2004 10:57:32 20-MAY-2004 11:01:28 2004-05-20:11:01:28 VALID
    B 20-MAY-2004 10:58:22 20-MAY-2004 11:01:53 2004-05-20:11:01:53 VALID
    Note that the date under the column 'created' only changes when you really create or replace the procedure.
    Hence you can use the column 'created' of 'user_objects'.

  • How to find the last modified date of a workflow.

    How to find the last modified date of a workflow.
    thanks.

    Hi,
    There is nothing as standard that does this - you could write some code to determine the latest begin_date from each of the workflow tables and assume that this was the last time that the definition changed.
    What you need is something like this:
    select max(wfa.begin_date)
    from   wf_process_activities  wpa
    ,      wf_activities          wfa
    ,      wf_item_types_tl       wit
    where  wpa.activity_item_type = wfa.item_type
    and    wpa.activity_name      = wfa.name
    and    wfa.version            = (select max(version) from wf_activities wfa1 where wpa.activity_item_type = wfa1.item_type and wpa.activity_name = wfa1.name )
    and    wpa.process_item_type  = 'your item type'
    and    wpa.process_item_type  = wit.namewhich I think gives what you want.
    HTH,
    Matt
    Alpha review chapters from my book "Developing With Oracle Workflow" are available on my website:
    http://www.workflowfaq.com
    http://forum.workflowfaq.com
    NEW! - WorkflowFAQ Blog at http://thoughts.workflowfaq.com

  • How to get last modified date and time of a file which is in apache server.

    Hi ,
    I need to get last modified date and time of a file in remote machine.
    This file is in remote machine which has apache server installed.
    I am trying to get this information by connecting to apache server from client by giving absolute URI of the file to file object.
    URI is got from apache server URL by using toURI method.
    when I use lastModified method , its throwing exception , because scheme of URI is not file.
    I can't give scheme as file because ftp server is not installed on that server
    Is there any other way to get this information .

    No, unless you can use an FTP client.

  • Reportable Last Modified Date and Time Field

    Reportable Last Modified Date and Time Field
    Hello,
      We need a reportable RequestCenter 'last modified date/time' database field that is refreshed when the 'Comments and History' field is updated.  Any ideas would be appreciated.  Thanks! 

    No, unless you can use an FTP client.

  • Get last modified date and time of sharepoint site through Search

    Hi All,
    I am trying to get the last updated date and time of a sharepoint site using KeywordQuery.
    For this I updated an existing list item, added a new item in a site and crawled the content. Then I used "ContentClass:STS_Site" as query in C# code to fetch the search results. I am able to get most of the properties I require for that
    site. However "LastModifiedTime" does not return the correct value. It returns an older value.
    How can I get the last updated date of a sharepoint site using search ?
    Regards,
    Vipul Kelkar

    No, unless you can use an FTP client.

  • How can you find the Last Modified Date of a particular table

    Hi,
    I want to show to the LAST MODIFIED date of a particular table to the user before refreshing the table with new data. Experts please suggest me the way using JDBC-SQL connection.

    There is no generic SQL way for this. It depends completely on the features your DBMS offers. With Oracle you'd need to create column which gets updated in a trigger. I believe MS SQL Server offers a special data type for this, which is updated automatically. I don't know about others.

  • Finding the Sample Library File and the Wyoming Folder

    I had a 30 day trial and purchased the activation code (not the DVD). The "Exploring Aperture" tutorial mentions getting the Sample Library File and Wyoming Folder from the installation disk. Since I don't have an installation disk, does anyone know where I can get the Sample Library File and Wyoming Folder?

    Chaz9,
    Welcome to the user-supported Aperture discussion group. Have you read the terms by which Apple runs forum? http://discussions.apple.com/help.jspa
    Your question has come more times than you cam imagine. Here's one recent thread.
    http://discussions.apple.com/thread.jspa?messageID=12898247&#12898247
    nathan

  • How to find the last modified documents

    Hi
    Is there any navigation iview which displays last modified documnets or any custom development is required.
    I have a requirement to prepare an iview which shows the latest 10 documnets and each document have a link
    When end-user enters portal there’s no functionality to show what is new or has been modified from last visit. By creating such an iView that will go through KM Documents and list last modified to an iView as links this functionality can be established.
    Links will open either to new browser window or navigate users to that document in portal.
    While iView creates list of modified documents, permissions to those files need to be checked. No links to files which user does not have permissions will not be shown in iView.
    Configurable custom properties:
    Amount of documents listed in iView can be configured from iView properties. For example:
    Amount Of Documents = 10
    can you please suggest in the above problem?

    Hi Durga,
    there is a How-To Guide on how to create an iView that displays the latest 10 documents (with links).
    Here the link:<a href="https://websmp208.sap-ag.de/~sapidb/011000358700007276522005E.ZIP">Configuring the Last10Documents Scenario</a>
    Hope it helps you solve your problem,
    Robert
    PS: If you have further questions, feel free to ask.
    PPS: If you question has been answered like in this <a href="https://forums.sdn.sap.com/thread.jspa?threadID=142186">thread</a>, you should mark the question as solved and can also use the blue star if you like

  • PS Script to find the list of users and the groups in a Workgroup server

    Hi There, could you please explain on how to get a complete list of local users and local groups in a "Workgroup" server to which they belong to using Powershell. I'm able to get the users list but couldn't find any help in finding
    the script to find to which localgroup the user belong to. Anticipating your response. Also let me know the cmdlet for Win2k3 servers to find the same.

    Here's some code from David Pham (don't remember wher I fund this code):
    Trap {"Error: $_"; Break;}
    Function EnumLocalGroup($LocalGroup)
    $Group = [ADSI]"WinNT://$strComputer/$LocalGroup,group"
    "Group: $LocalGroup"
    # Invoke the Members method and convert to an array of member objects.
    $Members= @($Group.psbase.Invoke("Members"))
    ForEach ($Member In $Members)
    $Name = $Member.GetType().InvokeMember("Name", 'GetProperty', $Null, $Member, $Null)
    $Name
    # Specify the computer.
    $strComputer = gc env:computername
    "Computer: $strComputer"
    $computer = [adsi]"WinNT://$strComputer"
    $objCount = ($computer.psbase.children | measure-object).count
    $i=0
    foreach($adsiObj in $computer.psbase.children)
    switch -regex($adsiObj.psbase.SchemaClassName)
    "group"
    { $group = $adsiObj.name
    EnumLocalGroup $group }
    } #end switch
    $i++
    } #end foreach

  • Need an app or a script to find a list of files and retrieve them

    A few years ago at an old job I used an application that could search a hard drive for a list of images all in one shot. The names of the images were typed into a txt file. the text file was used as the search list and the application would report back if the images were found and it would retrieve them. Where can I get my hands on something like This or can it be built in Automator?

    'I used an application that could search a hard drive for a list of images all in one shot ... and it would retrieve them.' - desired result is too vague.
    'Where can I get my hands on something like this ... - perform a 'Google' or equivalent search.
    "... or can it be built in Automator?' - possibly yes.
    On your behalf the above request is re-written below.
    Can someone assist me in AppleScript scripting. I am trying to open a '.txt' file which lists on each line a file to search for, and if found - to open its containing folder. Is such a process also possible with 'Automator'? Thank you for any assistance.
    One possible AppleScript solution:
    -- Code starts here --
    set tFile to read (choose file) -- One was to obtain the file, to open.
    set tPars to paragraphs of tFile -- create a list of paragraphs of selected file.
    repeat with i in tPars -- Cycle through the list of paragraphs.
    with timeout of 0 seconds -- Prevent AppleScript timeout error.
    set tItems to paragraphs of (do shell script ("locate " & (quoted form of i))) -- Obtain list of found filename files.
    end timeout
    repeat with j in tItems -- Cycle through the list of found file.
    try
    set {oAStid, AppleScript's text item delimiters} to {AppleScript's text item delimiters, "/"} -- Extract container of file.
    set fPath to text items 1 through -2 of j
    set AppleScript's text item delimiters to "/"
    set fPath to fPath as string
    set AppleScript's text item delimiters to oAStid
    do shell script ("open " & fPath) -- Open container of file.
    end try
    end repeat
    end repeat
    -- Code ends here --
    If the above sample code is not exactly what you seek - then edit the code accordingly; and / or post requests with specific details.
    'Is such an action also possible with 'Automator'?' - please post an properly constructed request to the 'Tiger - Automator'
    forum.

  • File names with last changed Date and time in a directory

    Hi All.
    I need to get all filename, last changed date, last changed time in a directory. Is there any function module for this?
    Regards,
    Venkat.

    hi,
    if the directory is in any application server try to use this code
    >  DATA: wa_file TYPE zdpp_file_read.
    >  DATA: nomefile(75).
    >  DATA: ext_chek(3).
    >DATA: BEGIN OF wa_file,
    >        dirname     TYPE DIRNAME_AL11, " name of directory
    >        name        TYPE FILENAME_AL11," name of entry
    >        type(10)    TYPE c,            " type of entry.
    >        len(8)      TYPE p,            " length in bytes.
    >        owner(8)    TYPE c,            " owner of the entry.
    >        mtime(6)    TYPE p,            " last mod.date, sec since 1970
    >        mode(9)     TYPE c,            " like "rwx-r-x--x": prot. mode
    >        useable(1)  TYPE c,
    >        subrc(4)    TYPE c,
    >        errno(3)    TYPE c,
    >        errmsg(40)  TYPE c,
    >        mod_date    TYPE d,
    >        mod_time(8) TYPE c,            " hh:mm:ss
    >        seen(1)     TYPE c,
    >        changed(1)  TYPE c,
    >      END OF file.
    >  data: files like wa_file occurs 0 with header line.
    >
    >  CALL FUNCTION 'FILE_GET_NAME'
    >       EXPORTING
    >            client           = sy-mandt
    >            logical_filename = logpath
    >            operating_system = sy-opsys
    >       IMPORTING
    >            file_name        = path
    >       EXCEPTIONS
    >            file_not_found   = 1
    >            OTHERS           = 2.
    >  IF sy-subrc <> 0.
    >    RAISE file_not_found.
    >  ENDIF.
    >
    >  DATA: last_path TYPE i.
    >  DO.
    >    last_path = strlen( path ).
    >    last_path = last_path - 1.
    >    IF pathlast_path(1) = '/' or pathlast_path(1) = '\'.
    >      EXIT.
    >    ELSE.
    >      CLEAR path+last_path(1).
    >    ENDIF.
    >  ENDDO.
    >
    >  MOVE extension TO ext_chek.
    >  TRANSLATE ext_chek TO UPPER CASE.
    >  nomefile = '*'.
    >
    >  CALL 'C_DIR_READ_FINISH'
    >      ID 'ERRNO'  FIELD wa_file-errno
    >      ID 'ERRMSG' FIELD wa_file-errmsg.
    >
    >  CALL 'C_DIR_READ_START' ID 'DIR'    FIELD path
    >                          ID 'FILE'   FIELD nomefile
    >                          ID 'ERRNO'  FIELD wa_file-errno
    >                          ID 'ERRMSG' FIELD wa_file-errmsg.
    >  IF sy-subrc <> 0.
    >    RAISE wrong_directory.
    >  ELSE.
    >
    >    DO.
    >      CLEAR wa_file.
    >
    >      CALL 'C_DIR_READ_NEXT'
    >        ID 'TYPE'   FIELD wa_file-type
    >        ID 'NAME'   FIELD wa_file-name
    >        ID 'MTIME'  FIELD wa_file-mtime
    >        ID 'ERRNO'  FIELD wa_file-errno
    >        ID 'ERRMSG' FIELD wa_file-errmsg.
    >      IF sy-subrc <> 0.
    >        EXIT.
    >      ENDIF.
    >
    >        PERFORM p6_to_date_time_tz(rstr0400) USING wa_file-mtime
    >                                                   wa_file-mod_time
    >                                                   wa_file-mod_date.
    >      MOVE path TO wa_file-dirname.
    >      APPEND wa_file TO files.
    >    ENDDO.
    >  ENDIF.
    >
    >  CALL 'C_DIR_READ_FINISH'
    >      ID 'ERRNO'  FIELD wa_file-errno
    >      ID 'ERRMSG' FIELD wa_file-errmsg.
    bye,
    marco

  • Show the last edit date and time ?

    I can't find a way to see the actual date and time of the last edit made. I see where you can sort the view by this in grid mode.
    Has anyone figured this out?
    Thanks.

    You can see it in the Metadata panel with the EXIF or ALL sets. There isn't a way to display it on the image using View Options, however.

  • How can we update the last synchronization date and time..on SUP in sccm 2012 R2

    Hi,
        Can you any one please guide me how can i update the last  synchronization date & time in SUP on SCCM2012 r2 , some how its updated as future date and when ever i try to synch the SUP with disconnected WSUS its shows in the wsyncmgr.log 
    "Wakeup for a polling cycle " and  " Wakeupby inbox drop" and "Wakeup by SCF change"  
    Thanks 
    Balaji K

    You'll probably have to call CSS on this one as this not normal by any means. The messages you noted above are completely normal but if that's all you are seeing then there's an issue.
    Have you reviewed wcm.log and wsusctrl.log?
    Jason | http://blog.configmgrftw.com | @jasonsandys

  • Last execution date and time of a transaction

    Hi,
    Could anyone let me know the procedure to find the last execution date and time of a transaction (for example MM01/MM02). We are currently working on ECC6.0
    Raja

    Hi Raja,
    Check table CDHDR, fetch data against T code MM01/MM02 and get MAX(UDATE) and MAX(UTIME).
    You will get last execution date and time.
    Please reqward ponits if it useful.
    Regards
    Krish

Maybe you are looking for

  • Memory issues with Oracle BPM 10gR3 application

    Hello, We have been running the load test(100 concurrent users) on our web application that is developed using Oracle BPM 10gR3 and seeing stuck threads on rendering the workspace page in JSF API(method createAndMaybeStoreManagedBeans). I copied one

  • Shortcut to find a property from property pallate in oracle 10G forms

    Hi, I want to know the the shortcut to find a property from property pallete in oracle 10G form builder. Because i cannot use mouse due to blindness. Please tell shortcut to locate a property from property pallete. Qasim Javaid Malik

  • Report painter YCOS variables

    Hello  I have transported a request and I got  the message about this report YBCOS in the system target Report YBCOS YCS: Variable &YBLEDG, &YBSEGF, &YBSEGT  either does not exist or is not suitable Message no. GR795 Diagnosis Report YBCOS for librar

  • Bridge table or factless fact table?

    Hello, I have a model a bit different that I've worked with in OBIEE (10), and I can't make it work. I have 1 fact table and two dimensions, joined this way in the physical layer: Fact Table >- Dim Person -< Dim Address The join between Fact Table an

  • Initializing shockwave projector file on different desktop

    Hello everyone, I am trying to start a shockwave projector / dcr on a second windows desktop. The "shockwave"-desktop is hidden during the loading phase of the director file. The problem is that the shockwave window is completely white after I activa