|Ok so here is my script so far:|
set publiclink=http://(host)/u/(unique ID)/
if exist "public\index.html" del "public\index.html"
for /r "public" %%g in (*) do echo ^<a
the purpose, as you can see, is to get a list of files within a directory, which the script also resides in.
It also gathers a list of files within sub-folders as well.
It outputs that text to an HTML file in a link:
Here is the problem:
It outputs ONLY file names.
This would be an easy fix, except that I don't need the FULL PATH. I only want the sub-path. In other words, if the script is in C:\folder, and the file is in C:\folder\public, I want the script to return something like "public\filename.ext"
Does that make sense?
I don't care how we have to do it, even if it has to be customized for each user (it's in a sub-directory of the user folder, usually desktop or documents) - but I need to figure out a way to do that.
If you folks can help me out a bit, I would be eternally grateful! :)
EDIT: For added clarity, I wanted to specify that this is for a program which takes a folder and hosts the files in it, on a server. The structure of the URL to that file is:
www.(our server).com/(folder containing file, if any)/(file name).(extension)
EDIT2: One method I thought of was to grab the full path of all files in that folder and its sub-folders, then strip out the previx (c:\users\%username%\etc.) but that would be difficult, especially since we'd have to ask the user to change the script to fit their installation path.
maybe we can do something like....
look for the path the script is being run from, save that to var1, then get the full path of all files in their sub-folders and remove any instances of "var1" from that text?
I wouldn't know how to do this; still learning! :P