Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Append file name on download

Status
Not open for further replies.

cpm23

Technical User
Mar 18, 2005
142
US
I am using a script I found in this forum to back up Option 11c PBXs (thanks smford). I have to back up multiple sites. The script gets the file name from filenm = $date. I would like to append that with the site name. I'm not too familiar with wrinting scripts. Can anyone help? Thanks
 
If you have the site name in another string variable, you could use the strcat command to concatenate that variable (containing the site name) to the end of the filenm variable.

 
Thanks, Knob. I can't seem to get it to work. It gets it's name from the Filenm = $date. line. If I change that to $dilconnect, it puts in the sit name from the Connection Directory. I'd like to have both, if possible. Below is the beginning of the script:


integer Position = 1
string szPath = "C:\Opt11cbackup" ; Path to file.
string filenm = $NULLSTR
filenm = $date ;sets the name from Control Panel
while (Position != 0)
strfind filenm "/" Position ;searches for / (illegal character)
if failure ;tests for a failure
Position = 0 ;sets condition to False
else ;successful search
strdelete filenm Position 1 ;removes illegal character
endif
endwhile
while (Position != 0)
strfind filenm "-" Position ;searches for -(illegal character)
if failure ;tests for a failure
Position = 0 ;sets condition to False
else
strdelete filenm Position 1 ;removes illegal character
endif
endwhile
addfilename szPath filenm ; Adds the file name to path.
 
Thanks again, but it doesn't work. Like I said I don't know much so pardon my ignorance. Here's the error I get:

Error C024 Line 7: Invalid command or expression token: STRCAR
 
Knob, thanks for your time. I still couldn't get it to work, so I just changed filenm to $dialconnect and I'll use the date stamp on the file so I'll know when it was downloaded. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top