Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm using a simple cmd batch file to deploy my Asp.net MVC web application to server network share.

The problem I'm having is that my DLLs can't be simply replaced by new files since existing ones are in use by the IIS. I'm not an admin on the server so I don't have rights to run iisreset remotely.

What I can do is I can open root web.config file and save it, hence forcing IIS to stop my web application and as a result to this I can replace my assemblies.

Question

Since I deploy my app using an automated batch file I'd like to include this web.config file re-save inside it before I start deploying DLLs. Anybody knows how can this be done in cmd? Maybe a change of the file's last modified timestamp would suffice.

Possibile solution

I suppose I could as well write a console application that would change last modified timestamp to DateTime.Now but I don't want to write the code myself. Anyone knows of such existing code on the net, since I can't find it. Or even a command prompt tool (console app without user interaction)?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Grab a copy of UnixUtils from http://unxutils.sourceforge.net/, there is a command in there called touch which you can use to update the timestamp on the file as you need. Just copy the executable up with your batch file, and add a call to touch web.config and you should get what you need.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.