Solved

change file timestamp

Posted on 2008-10-15
8
1,067 Views
Last Modified: 2012-05-05
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
Comment
Question by:dlcnet
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 3

Expert Comment

by:Angelized
ID: 22719443
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
 
LVL 67

Expert Comment

by:sirbounty
ID: 22719682
how about simply using the native copy command:

copy filename.txt +b
0
 
LVL 3

Expert Comment

by:Angelized
ID: 22721006
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
Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

 
LVL 38

Accepted Solution

by:
Shift-3 earned 500 total points
ID: 22721309
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
 

Author Comment

by:dlcnet
ID: 22724510
@ 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
 
LVL 67

Expert Comment

by:sirbounty
ID: 22726903
Then will http:#22719682 work for you?
Just change the filename (and input the path, as necessary)...
0
 

Author Comment

by:dlcnet
ID: 22728677
@sirbounty
the link goes to a Outlook2003 question. Are you sure this was the correct number?
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 22730035
No, it goes back to my comment located above...
The copy command I mentioned:

copy filename.txt +b
0

Featured Post

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you receive another warning that your shared drive is almost full and you have asked your users to clean out old files again and again, here is a single command that may help. This command will place all the files that have not been used rec…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question