Files Properties

Igorek83

New member
Local time
9:40 PM
Messages
7
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

OS
Windows 7 Ultimate x86
Sound Card
Realtek AC'97 driver ver. 6.0.1.6305
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

OS
.
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

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Home Made
OS
Linux Mint 17 Cinnamon | Win 7 Ult x64
CPU
Intel I7-3770K @ 4.2ghz
Motherboard
ASRock Extreme 4
Memory
32GB G-Skill C10Q
Graphics Card(s)
EVGA GTX 670 2GB SC
Sound Card
Creative Fatality ExtremeGamer
Monitor(s) Displays
LG E2742V x 2
Screen Resolution
1920x1080
Hard Drives
256GB Vertex 4 SSD
2TB Seagate ST2000DM001
1TB Seagate ST1000DM003
PSU
Corsair HX 650
Case
HAF 932 advanced
Cooling
Corsair H100i liquid cooler
Keyboard
Logitech Wireless
Mouse
Logitech Wireless
Internet Speed
OptusNet NBN 100/40
Antivirus
Malwarebytes
Browser
Firefox 30
Other Info
Router: Sagemcom F@st 3846 Crippled by Optus.
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:

My Computer

OS
Windows 7 Ultimate x86
Sound Card
Realtek AC'97 driver ver. 6.0.1.6305
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

OS
Windows 7 Ultimate x86
Sound Card
Realtek AC'97 driver ver. 6.0.1.6305
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

OS
Windows 7 Ultimate x86
Sound Card
Realtek AC'97 driver ver. 6.0.1.6305
Back
Top