Solved

change file timestamp

Posted on 2008-10-15
8
1,069 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
Turn Insights Into Action

You’ve already invested in ITSM tools, chat applications, automation utilities, and more. Fortify these solutions with intelligent communications so you can drive business processes forward.

With xMatters, you'll never miss a beat.

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
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…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

696 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