How to create bat file to publish to a web server.
Posted on 2006-04-12
I used to work with a guy that showed me how to set this up before, but don't remember how to do it. Basically, he created a .bat file called Publish and somehow inserted it in the "right click" menu. So, when I was done working on a file I could right click on the file on my development server and it would transfer the file to the production server. It the file already existed on the production server, it would overwrite it. Here is the code from that publish.bat file:
@if not exist "F:%~p1" mkdir "F:%~p1"
@for /f "tokens=*" %%a in ('dir %1 /b') do @copy %1 "F:%~p1\%%a"
Here is my problem... this does not work and I don't remember how to put it in the right click menu. On my current laptop... my development server is mapped drive of Z: and my production server is a mapped drive of O:. So, here is the order of things that I need to happen. I am using my laptop to connect to my development project via VS.net. I would like to be able to have a windows explorer window open displaying the files on my development box. I would like to right click on any file in that dialogue box and click on publish and a copy of that file would be put on the production server.
Any help would be great.