Files Properties


  1. Posts : 7
    Windows 7 Ultimate x86
       #1

    Files Properties


    Hello..

    I need help to create some script that will run once a day on system start-up.
    The main goal is to retrieve the creation date and time of all the files in a specific folder and save them to some txt file.
    The secondary goal is to send this file via VPN to another machine.
    Another secondary goal is to automatically archive the txt file (rar or something) with a password before i send it via the network.

    I do have knowledge of JAVA/C# but i was thinking maybe there is a simpler way than to create a program.

    Thanks.
      My Computer


  2. TCG
    Posts : 190
    .
       #2

    Whatever language you decide to go with, this is going to be a very particular script and functionality. I don't foresee you finding a tool/utility to make this any easier for you unfortunately. I think you're just going to have to bite the bullet and start coding this to fit your needs, in whatever language you're most comfortable with. :)
      My Computer


  3. Posts : 784
    Linux Mint 17 Cinnamon | Win 7 Ult x64
       #3

    Igorek83 said:
    Hello..

    I need help to create some script that will run once a day on system start-up.
    The main goal is to retrieve the creation date and time of all the files in a specific folder and save them to some txt file.
    The secondary goal is to send this file via VPN to another machine.
    Another secondary goal is to automatically archive the txt file (rar or something) with a password before i send it via the network.

    I do have knowledge of JAVA/C# but i was thinking maybe there is a simpler way than to create a program.

    Thanks.
    Wouldn't this be possible in a simple batch file?

    dir /tc /o-d /b >filelist.txt

    When you install Winrar you also get rar.exe and unrar.exe. So, as long as rar.exe is in your path you'll be ok. You can do this with

    (x86 version)... set path=%path%;c:\program files (x86)\Winrar
    (x64 version)... set path=%path%;c:\program files\Winrar

    The rar command would be

    rar a filelist.rar filelist.txt -pmypass

    There are many ways to run a task at start up.. This might help .. Understand and Control Startup Apps with the System Configuration Utility

    If the files are in c:\myfiles, and winrar is installed in c:\program files\winrar this might be your cmd file...

    @Echo Off
    set path=%path%;c:\program files\Winrar
    cd \my files
    dir /tc /o-d /b >filelist.txt
    rar a filelist.rar filelist.txt -pmypass
    del filelist.txt

    There are also several vpn programs and ways of sending files. Again, you could look at the examples per the website above...

    hth
      My Computer


  4. Posts : 7
    Windows 7 Ultimate x86
    Thread Starter
       #4

    Tanyam, thank you very much. It is almost what i needed.
    What i need is the dates and time, and sort the list by date and time.
    This is what i needed: dir /o:d

    I wonder if there is a way to show ONLY the date and time.

    Maybe i can open the filelist.txt and remove all the characters after the 20th character on every line.
    Any ideas how to do this in the bach file?
    Last edited by Igorek83; 22 May 2011 at 08:49.
      My Computer


  5. Posts : 7
    Windows 7 Ultimate x86
    Thread Starter
       #5

    Ok.. After learning the FOR loop in batch, I mannaged to create exactlly what i needed:

    Code:
    @Echo Off
    set path=%path%;c:\program files\WinRAR
    cd \files
    dir /o:d *.txt >raw.txt
    FOR /F "tokens=1,2 skip=4" %%G IN (c:\files\raw.txt) DO ECHO %%G %%H >>dates.txt
    rar a dates.rar dates.txt -pmypass
    del raw.txt
    del dates.txt
      My Computer


  6. Posts : 7
    Windows 7 Ultimate x86
    Thread Starter
       #6

    Ok.. This is the complete bat file. Here I also send the file on a shared folder in the vpn:
    Code:
    @Echo Off
    set path=%path%;c:\program files\WinRAR
    cd \files
    dir /o:d *.txt >raw.txt
    FOR /F "tokens=1,2,3 skip=4" %%G IN (c:\files\raw.txt) DO (
    	ECHO %%G %%H %%I >>dates.txt
    	)
    pushd \\192.168.0.1\path
    rar a dates.rar c:\files\dates.txt -pPASSWORD
    popd
    del raw.txt
    del dates.txt
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 05:35.
Find Us