开发者

How can I make a web page show the contents of a file even after I change the file?

He开发者_如何学运维y everyone I got a wiki question. We store files in *.7z in one server and have a wiki on another. I need to make a script that pulls the file names from one script and adds the code behind it so I can post it in the wiki. We do a ton of files a month and typing them all by hand won't cut it.

Here is what I need.

Var filename or string

For each file in the list {
Filename= File

    Write ('<br><file>SERVERNAME\C$\VideosArchive\ '+Filename+ '|' +Filename+ </file> <br/>)

So when the output comes out it has to look like.

<file>\\SERVERNAME\c$\VideoArchive\FILENAME.7z|FILENAME</file>

but i need something that auto generates that if that makes since.


Something like this?

pushd \\servername\C$\VideosArchive
rem by the way, you should make that a share instead of using C$. Plays nicer with privileges and stuff
for %%f in (*) do (
  echo ^<br^>^<file^>SERVERNAME\C$\VideosArchive\%%~nxf^|%%~nxf^</file^>^</br^>
  rem do I need to ask why you are using "br" as if it had content? It's a tag without content ...
)
popd


Sounds like a very simple task. You could create an app or PowerShell script to perform the dynamic creation of this file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜