Hi, I hope someone can help as I'm at the limit of my limited knowledge of DOS and .bat files...
Basically, on a Windows 2000 server, I am limited to receiving the following command from an application:
ftpupload.bat [filename.jpg]
So I may well receive the following as an example:
ftpupload.bat articles\new_logo.gif
If I was receiving the filename on it's own I'd be fine, but I need to try and split the string received at the \ character so I have "articles" and "new_logo.gif" as two separate "variables" in the DOS program.
I'm sort of getting there, I've been researching and have found the following:
::Deletes all characters prior to the \
SET _completeString=articles\testing.jpg
REM above will be replaced with %1 to take a parameter to _completeString
SET _filename=%_completeString:*\=%
ECHO %_filename%
This gives me the file name: testing.jpg assigned to the variable _filename however I'm confused as to how to get the test before the \ out to a variable called _directory .... :-(
The idea is FTP the file up to the server, but I need to know which directory it's to be uploaded to (in this instance "articles")... so the big question, can I split the string I'm receiving in DOS and assign this to variables or similar (excuse the terms, I tend to program VB on the whole). I could receive ftpupload.bat menu\home_button.gif or ftpupload.bat thumbnails\new_product.jpg etc... so it's not as if the directory is fixed.
Many thanks for any help!
Sorry for what may be a silly question,