views:

29

answers:

1

I am trying to make a .bat file to edit the redirect in index.asp to be the filename of the file selected via the context menu option .bat file.

I know how to replace the file:

@echo OFF
del/q D:\e-lib\index.asp
copy %1 D:\e-lib\index.asp

but not how to edit the contents so that the redirect within index.asp points to the filename of the file I right-click, i.e the value %1.

A: 

I'm not sure about editing a file via DOS BATCH file, but you could easily pump in the contents of the file using the print command (e.g. "something" > file.asp). You could also build a template that reads in a text file via ASP, that has the contents of the data you need to include in your dynamic ASP file.

Zachary
Sorry, I'm not being very clear.I'm trying to manage a school local web-site and want to quickly be able to change the index page to one of the hundreds available and up until now have replaced the file, which is OK for pages with no media content, but means I would have to edit every page to have absolute adressing for images etc. I thought I could create a file index.htm or .asp etc and delete the previous.....
Thai