Appending a creation date/time stamp to a filename using MS Command Language

I need to access the creation date and time of an existing file and then append that date/time to the filename using MS command language in a .bat file.  The code executes on a Windows server.   I'm looking at different options for doing
this.  I know it can be done using MS Powershell scripting.  Any other suggestions appreciated.  Thanks

I tested the answer you supplied here:
http://social.technet.microsoft.com/Forums/en-US/38873a13-f3f2-40f2-bb96-c1c63722caab/adding-a-datetime-stamp-to-a-file-using-ms-command-language?forum=winserverpowershell
and it worked.
Richard Mueller - MVP Directory Services

Similar Messages

  • Oracle Role Creation Date time stamp

    Hi All ,
    Can anyone pls help me to find out the Date time stamp when a Role has been created into database .
    Your early response will be appreciable.
    Many thanks ,

    Hi,
    >>Actually I am searching through google to see the each column name description for sys.user$ but not able to find anything useful
    These base tables are not documented (public) ... It seems that PTIME column stores the time stamp information when the password's user has changed.
    SQL> create user myuser identified by myuser;
    User created.
    SQL> select
      2    name,
      3    to_char(ctime,'dd/mm/yyyy hh24:mi:ss') ctime,
      4    to_char(ptime,'dd/mm/yyyy hh24:mi:ss') ptime
      5  from
      6    user$
      7  where name='MYUSER';
    NAME            CTIME               PTIME
    MYUSER          30/04/2008 10:52:25 30/04/2008 10:52:25
    -- waiting some time ...
    SQL> alter user myuser identified by legatti;
    User altered.
    SQL> select
      2    name,
      3    to_char(ctime,'dd/mm/yyyy hh24:mi:ss') ctime,
      4    to_char(ptime,'dd/mm/yyyy hh24:mi:ss') ptime
      5  from
      6    user$
      7  where name='MYUSER';
    NAME            CTIME               PTIME
    MYUSER          30/04/2008 10:52:25 30/04/2008 10:53:08Cheers
    Legatti

  • How do you vary the Date/Time stamp format in File Adapters

    In the receiver channel of the File Adapter where you specify the 'File Name Scheme', you do have the option of specifying a 'File Construction Mode' of 'Add Time Stamp'.  How can you specify a different Date/Time stamp format ( eg MM/DD/YY vs YYYYMMDD vs MMDDYY, etc. ) without changing the Date/Time stamp for the entire SAP system?  Also, can you control where the Date/Time stamp appears in the filename?

    Hi,
    There are many threads discussing the same issue. Go thro the following:
    Dynamic file name (Date) in Receiver File Adapter
    Receiver File Adapter - TimeStamp
    Bhavesh's reply in above thread:
    You can use Adapter Specific Identifiers and then change the file name in the mapping. Append the tiem stamp in the format that you want and so on.
    Just use this code in an UDF,
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String SourceFileName = conf.get(key);
    java.text.SimpleDateFormat dateformat = new java.text.SimpleDateFormat( "yyyyMMdd" );
    dateformat.format( new java.util.Date() );
    String newfilename=SourceFileName+dateformat;
    // change to new file name
    conf.put(key, newfilename);
    return "";
    Regards,
    P.Venkat

  • FileMonitor issue for date time stamp change.

    Hi I have an app that runs with a minor issue and I am looking for some insight for a workaround or code change.
    I have a File Monitor that checks a specific directory every second.
    Users send a batch run to this directory throughout the day. There are two types of files, .ZIPs and .DONEs.
    So for each .ZIP a .DONE is sent to notify the app it can begin to process the file.
    Here is what I receive
    /elements/process/File1.ZIP     Oct 15 08:19
    /elements/process/File1.DONE     Oct 15 08:19
    The problem I am encountering is sometimes the .DONE and. ZIP are sent and the date time stamp of both files are the same so when the monitor reads the directory it looks like there is no change so both files sit in the directory and do not process. To make this work, I usually go in and touch a file to change the date time stamp.
    This is a java app that runs on an AIX box.
    Here is my code, is there anything any once can suggest to help me out. Thanks in advance.
       * Subclass of FileMonitor, Handles the timer event
       * @param none
      private class FileMonitorNotifier extends TimerTask
        public void run()
          // Loop over the registered files and see which have changed.
          // Uses the Modifed DateTimeStamp to determine if there was a change.
          // Use a copy of the list in case listener wants to alter the
          // list within its fileChanged method.
            try
                Collection files = new ArrayList (hmFiles.keySet());
                for (Iterator i = files.iterator(); i.hasNext(); )
                    File file = (File) i.next();
                    long lastModifiedTime = ((Long) hmFiles.get (file)).longValue();
                    long newModifiedTime  = file.exists() ? file.lastModified() : -1;
                    //      Check if file has changed
                    if (newModifiedTime != lastModifiedTime)
                        //      Register new modified time
                        hmFiles.put(file, new Long (newModifiedTime));
                        // Notify listeners
                        for (Iterator j = colListeners.iterator(); j.hasNext(); )
                            WeakReference reference = (WeakReference) j.next();
                            FileListener listener = (FileListener) reference.get();
                            // Remove from list if the back-end object has been GC'd
                            if (listener == null)
                                j.remove();
                            else
                                listener.fileChanged (file);
            catch(Exception ex)
                 m_odLaunch.logError(OdIntegrationConstants.ERROR_LEVEL_MIDLEVEL, ex);
         }

    Yes, I guess you are right, I don't care what time each file came, as long as I have both I can being to unzip and process and delete the .DONE.
    The code itself was based on if a filechanged then do work.... I could just take this out. Thanks!
    * This is the main entry point when there is a change to the modified date/time
    *  of the monitor directory
    * @param file directory we are monitoring
         public void fileChanged (File file)
              StringBuffer sbMessage;
              try
                   sbMessage = new StringBuffer();
                   //Make sure this is a Directory
                   if(file.isDirectory())
                        //Return list of files with extension we are looking for
                        File[] arFiles = file.listFiles((FilenameFilter)new FileSuffixMonitor(m_odLauncher));
                        for(int i=0;i < arFiles.length;i++)
                             sbMessage.append("Found file association to move-" );
                             sbMessage.append(arFiles.toString());
                             m_odLauncher.logInstance(sbMessage.toString());
                             processMoveFile(arFiles[i]);
              catch(Exception ex)
              sbMessage = null;

  • Save the file and give date & time stamp

    1. Reading the Excel file from the selection screen as a parameter.
    2. Using F.M. ALSM_EXCEL_TO_INTERNAL_TABLE reading Excel file into
        Internal table.
    3. Implementing the Business Logic.
    4. Move output to Final Internal table.
    5. Final internal table should generate a Flat file. By using GUI_DOWNLOAD.
    6. That flat file should be saved with the name and location given in the Excel.
    7. When ever I run the program output file will generate in the same location but with date and time stamp. Because I’m running the program for range of employees say initially I run for 1 – 10,000 employees next 10,001- 20,000 like that.
    Whenever I run for 2nd time it will overwrite the previous output, that’s the reason I’m using date and time stamp.
    Eg:
    PERSONAL Numbers              Name                                         Location
    00000001                 xxxxx-24.04.2007-10.30          C:\        
    00000002                 xxxxx-24.04.2007-10.35
    00000003                 xxxxx-25.04.2007-10.40
    00000004                                  xxxxx-25.04.2007-10.30
    Can any one help me how to save the file and give date & time stamp through hardcode?
    please help me in this issue.

    I am not clear with your problem. Based on the understanding of your question,
    there  can be two cases.
    1- U want to insert time stamp in the output file.
    2- Time stamp is already there, u just have to solve the overwriting issue.
    If your question goes with option 2, You can make use of import parameters
    <b>CONFIRM_OVERWRITE</b> : Which will ask for confirmation before overwriting.
    <b>APPEND</b> : which you can choose either to append the data to the existing file or overwrite it.
    Please inform if the issue is not resolved.
    Message was edited by:
            BINU RAJ BINU

  • Get the creation date time of the file located in persentation server

    Hi Experts,
    I have a requirement where i need to fetch the creation date time of a file.
    ex. file path :  C:\Documents and Settings\file.xml
    I have the file path, i need to know when this file is created.
    Is there any GUI services or FM to achieve this?
    Your help in this regard is highly appreciated.
    Kind Regards,
    Vidya

    Hi Sandeep,
    Thanks for your reply.
    Can you please explain in detail the procedure to Maintain a log table & fetching the
    creation date time of a file in persentation server.
    The requirement is :
    I have the directory path, which contains many xml files. ex : C:\Documents and Settings\Dir
    I have to fetch files ,which has been created between the specified time stamp.
    ex : October 24, 2008 to December 24, 2008
    So i need to fetch all the files from the directory "Dir" which has been created between
    October 24, 2008 to December 24, 2008.
    Regards,
    Vidya

  • How to print date & time stamp on photos?

    How to print date & time stamp on photos?

    Three methods:
    File>process multiple files>labels. Be sure to uncheck "same as source", or the originals will be overwritten. It is best to work on duplicate files, esp. while learning.
    Use the horizontal or vertical type tool to add the information manually to each picture file
    If the same information is to be applied to several pictures, e.g. a copyright notice, use  of a brush made in PSE is very efficient

  • The export file from a calc script - naming and date/time stamp

    Here is a simple calc script to export data.
    2 questions:
    1. Is there an easy way to add a date/time stamp on the name of the data file so that it does not overwrite the older ones every time?
    2. I tried to specify the path so that it write to another server. "\\mfldappp011\E:\Exp_AW.txt". It's not working. How should I specify the path ?
    Fix (@Relative("Yeartotal",0),"Actual","Working",&ActualYear);
    Dataexport "file" "," "C:\Exp_AW.txt" "#MI";
    EndFix;
    Edited by: user9959627 on Sep 7, 2012 11:25 AM

    Probably easiest to call the maxl script from a command line script, then rename the exported file to include the tme stamp and copy/move it to a location.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • How do I to get the date/time stamp back on my texts in ioS7?

    I've looked and looked to find an option and I can't seem to locate one.  Does anyone know how to put the date/time stamp back...?  It does appear in, but not consistently.

    Swipe right to left and they will appear as you need them.

  • Need to add date/time stamp to file name without time change creating new files

    We have setup our application to save data once a trigger event occurs. We also need the date/time stamp as part of the file name. We used Format Date/Time String and concatenated it into the file name. It all works good, but as the time changes (seconds, minutes, etc.) it causes the Write to File to create a new file with the new filename. Is there a way to create the file and save/latch/buffer the time in the file name so that it doesn't create a new file for every second?
    I've attached a shot of the relevant part of our VI. It's all in a big while loop. The data save is in a case/switch so that when it is triggered it starts saving. (The for loop is to split the data up
    into 4 different files). Like I said, it all works except new files are created every second as the time changes instead of just putting it all in one file with the initial time in the file name.
    Attachments:
    TimeInFileNameQuestion.jpg ‏46 KB

    I need a loop in order to use a shift register. I cannot stop the outer while loop (because it would stop the hardware from collecting data), and I cannot add loops inside which bogs down the processor to where the app stops. I've attached a simpler version of my VI which illustrates the problem. While the button is pressed (the trigger) it should save the data (in this case just cycle numbers) into one file with the initial date/time. But, you can see that it creates 1 file/second. I tried using shift registers, but without adding extra loops I can't see how to do it. Thanks
    Attachments:
    FileNameTest.vi ‏29 KB

  • How to add date/time stamp to PDF in Acrobat 9 Pro?

    Hello,
    I'd like to add a date/time stamp to a PDF so that when I print the document, the current date/time will be printed as well.  Is it possible to do this?  I found the following posting (http://forums.adobe.com/thread/502915), but am not able to get it to work for me.  I don't really know anything about using Javascript.  Any help would be much appreciated.
    Thanks!

    Not sure it will work, but you can try using the app.hideMenuItem() method. See reference here.

  • Date-Time stamp on CQ published pages

    Hello,
    How do I display last-published-date-time stamp for published CQ pages. This is critical to customers, as the date-time stamp determines the relevance of articles.
    Thanks,
    Suhas Yogin

    Try to adapt instance of com.day.cq.wcm.api.Page to com.day.cq.replication.ReplicationStatus and then use it's methods to get necessary data.

  • Date & Time stamp on QT movie playback

    Is there a way to turn on a date & time stamp on playback of QT movies provided that info is embedded in the QT info?

    Sach1n wrote:I want to put Date & Time Stamp on photos clicked via Nokia 5800XM. Is it possible?
    Hi Sach1n
    Unfortunately that is not feasible but you can view the EXIF Data on the 5800XM with a python application as per screenshot here:http://i35.tinypic.com/ht9ovs.jpg
    Happy to have helped forum in a small way with a Support Ratio = 37.0

  • Date & Time Stamp on photos clicked via Nokia 5800...

    Hi,
    Can anyone help me out on this.
    I want to put Date & Time Stamp on photos clicked via Nokia 5800XM. Is it possible?
    Thanks in advance

    Sach1n wrote:I want to put Date & Time Stamp on photos clicked via Nokia 5800XM. Is it possible?
    Hi Sach1n
    Unfortunately that is not feasible but you can view the EXIF Data on the 5800XM with a python application as per screenshot here:http://i35.tinypic.com/ht9ovs.jpg
    Happy to have helped forum in a small way with a Support Ratio = 37.0

  • How do I remove date/time stamp?

    Upon uploading the pictures into the Lightroom 'library' none of them appeared to have the date stamp that they did in camera. After a few minutes, the date stamp for each started to appear. Seeing that they first loaded without the date stamp leads me to believe that I should be able to remove it easily. How can I do this without the hassle of cloning/cropping/editing. Is there a way to remove it from the metadata perhaps?

    Which data/time stamp are you talking about, and why do you want to remove it?
    I mean, it can probably be done using exiftool, but usually people want to keep it/them (or correct if wrong..).
    I mean #2, I think you can remove it from exports, e.g. using a plugin like Jeffrey Friedl's Metadata Wrangler (if Lr's coarse handling doesn't satisfy), or if Jeffrey's plugin won't do it, a plugin like Exportant would.
    Or if you just want to remove it from display - then press the 'i' key, or adjust view options, or define a metadata viewing preset...
    Rob

Maybe you are looking for

  • Colours trouble with a psd file after import/export through Lightroom 4

    I'm working with CS5, and I just bought LR4. I took a psd file (in Adobe 98 space) and I imported it in LR 4, and the exported as psd file in Adobe 98 colour space. Both files, the original one and the other after import/export, are quite different.

  • App will not open after update from market.

    I have an android app that when I publish an update and the user downloads the update the app will not open.  It opens for a second and then closes. This happens even if I do not change anything in the update. The only thing I can find is that after

  • Stock display with Alternate unit of measure

    Hi All, is there any report in SAP, which displays the warehouse stock with Alternate Unit of measure. I did try in MB52. It was showing only in BUM. Please help ASAP. Ayesha

  • Mystery circle appearance after security update

    Since I did the last update over the weekend there now is a small transparent circle at the top left of my screen. This circle / spot is there no matter what I'm using. It's on the desktop, it's there with Safari, Firefox, iTunes, etc... With my iBoo

  • PCUI search result print functionality not working

    Hello Gurus!! The print functionality in search result doesn't seem to be working.. Is it not standard ? Please guide me with the steps in getting this work. Thank you Sreesanth