Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

change file timestamp

Posted on 2008-10-15
8
Medium Priority
?
1,089 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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

 
LVL 38

Accepted Solution

by:
Shift-3 earned 2000 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
This is a fine trick which I've found useful many times, when you just don't want to accidentally run a batch script or the commands needs administrator rights.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

604 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