Rename Files with 1 Click
Until recently, everytime I wanted to start Apache Web Server on my Windows ME PC and start work on my website I had to go to :
path: C:\windows\
and rename HOSTS.SAM back to HOSTS.
Then, when I wanted to get back online, on the Net and be able to access both my websites, I had to go once again to :
path: C:\windows\
and rename HOSTS back to HOSTS.SAM.
The main point of this article is to show you how to have a short-cut on your desktop that will re-name a file with just a click if you find yourself doing that more than often.
Create 'develop.bat'
Run Notepad, and type in the following:
c: cd\windows rename HOSTS.SAM HOSTS
Now save this file to your Desktop as develop.bat - please note the .bat file extension, it's not .txt!
Create 'online.bat'
Open a new page on NotePad and type in the following:
c: cd\windows rename HOSTS HOSTS.SAM
As done with the previous file, save this file also to your Desktop as online.bat
The rename command in DOS
Of the three lines in each file, let me just explain the format for the rename command in DOS :
rename existing_filename.ext new_filename.ext
Now when you need to start work on your website locally (i.e surf to your 'website' on your PC) all you have to do is double-click develop.bat on your desktop before starting your favourite web browser.
Once you're done testing your new pages; to upload any new or edited web page changes and to view your website on the WWW, just go to your desktop, double-click online.bat and start your Internet connection!
