Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.



Windows 7: Files Properties

20 May 2011   #1

Windows 7 Ultimate x86
 
 
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 System SpecsSystem Spec
.

20 May 2011   #2
TCG

 
 

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 System SpecsSystem Spec
22 May 2011   #3

Linux Mint 16 Cinnamon | Win 7 Ult x64
 
 

Quote   Quote: Originally Posted by Igorek83 View Post
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 System SpecsSystem Spec
.


22 May 2011   #4

Windows 7 Ultimate x86
 
 

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?
My System SpecsSystem Spec
22 May 2011   #5

Windows 7 Ultimate x86
 
 

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 System SpecsSystem Spec
22 May 2011   #6

Windows 7 Ultimate x86
 
 

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 System SpecsSystem Spec
Reply

 Files Properties





Thread Tools




Our Sites

Site Links

About Us

Find 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 11:24 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33