Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1095
  • Last Modified:

change file timestamp

Hi Experts!

I have a question which relates to change the time of a file. I would like to have a .bat script which do when executed a modification to  the time stamp of a file to the current time stamp.

Thanks!
0
dlcnet
Asked:
dlcnet
  • 3
  • 2
  • 2
  • +1
1 Solution
 
AngelizedCommented:
On solution for you would be to utilise
http://www.novell.com/coolsolutions/tools/18707.html

then to use it in a bat file you can
ChangeTime.exe [-c] <filename> <time.txt
the time.txt will contain by example
11-11-2008
22-22-22
11-11-2008
22-33-33
11-11-2008

Hope this help...
22-44-44

0
 
sirbountyCommented:
how about simply using the native copy command:

copy filename.txt +b
0
 
AngelizedCommented:
I assume he wanted to do it on a complexe data stucture. and thus avoid copy the whole data over again. and ChangeTime change also the creation date. Might be useful.
0
[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

 
Shift-3Commented:
You can also change the Modified date using vbscript.  You can change the Creation and Accessed dates using PowerShell.
http://www.microsoft.com/technet/scriptcenter/resources/qanda/mar08/hey0326.mspx
0
 
dlcnetAuthor Commented:
@ all
Thanks for the answers! Actually my problem is quite simple. I have a deployment descriptor on weblogic who automatically redeploys the application when the time stamp of a file is changed. Usually I open it first then I make a space then delete the sace and save it. After few secconds the deployer realise that a file is change and starts the redeployment. In order for me to avoid all this open - write - delete - save - close I wanted just to have a batch who does this for me.
0
 
sirbountyCommented:
Then will http:#22719682 work for you?
Just change the filename (and input the path, as necessary)...
0
 
dlcnetAuthor Commented:
@sirbounty
the link goes to a Outlook2003 question. Are you sure this was the correct number?
0
 
sirbountyCommented:
No, it goes back to my comment located above...
The copy command I mentioned:

copy filename.txt +b
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now