Solved

change file timestamp

Posted on 2008-10-15
8
1,063 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
  • 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
 
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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Edureka is one of the fastest growing and most effective online learning sites.  We are here to help you succeed.

911 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now