Hello, I have a form that uses fso to pull text file names into a form on an ASP page. I'd like the user to click an export button to send the chosen file over to another server. I have an export.vbs script but I don't now how to pass the value from the asp page to the script. Is there a way to do that? Script below. Hardcoded the script runs great. I don't know how to get the value from the form into the script. This is on an inhouse server.
strFilePath = "\\server1\jobs\source.txt
" I'd like source.txt to be the value of my form.
Is there a way to do this?
The script runs from the asp page like this:
<%if request.form("jobno")>"" then%>
Dim objFSO, objFileCopy, objGuyFile, objFileDelete
Dim strFilePath, strDestination, WinHttpReq
Dim strFileText, strFileText2, strFileText3
strFilePath = "\\server1\jobs\source.txt"
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FileExists(strDestination) then
' Delete file if it alread exists in the destination.
wscript.echo "File deleted from Server 2"
wscript.echo "File wasn't deleted."
Set objFSO = CreateObject("Scripting.FileSystemObject")
if objFSO.fileexists(strfilePath) then
Set objFileCopy = objFSO.GetFile(strFilePath)
' copy the file to destination
WSCript.Echo "The new file has been Copied to " & strDestination
wscript.echo "This didn't work. New file WAS NOT copied."
' End of Script