As a standalone script (fidm.vbs) it runs just fine and it uploads the file correctly. But when I embedd the script into an HTML page it doesn't work for me. I've pasted part of the code in this message. The message boxes are showing me the correct data but when it goes to ftp it bombs out...no errors just doesn't do it. The window pops up then closes so I don't know what it is telling me on the ftp part. Any help would be greatly appreciated. Thanks,Rich
<body>
<SCRIPT LANGUAGE="VBScript">
Sub runFIDM_onClick()
On Error Resume Next
Dim wsh
Dim tsScript
Dim fs
Dim strRemoteSite
Dim strUsrN
Dim strPssW
Dim objFolder
Dim FolderPath
Dim objFolder_Contain
Dim foundFile
Dim strFilename
Dim cdDrive
Dim intWindowStyle
Dim strFtpScriptFileName
Const TemporaryFolder = 2
Const WshHide = 0
Const WshNormalFocus = 1
Const WshMinimizedFocus = 2
Const WshMaximizedNoFocus = 3
Const WshNormalNoFocus = 4
Const WshMinimizedNoFocus = 6
'*******************************************************************************
'Retreiving values from form(id=frmGetInfo)
strUsrN = frmGetInfo.txtName.value
strPssW = frmGetInfo.txtPass.value
cdDrive = frmGetInfo.cdDrive.value
'*******************************************************************************
Set wsh = CreateObject("Wscript.Shell"
Set fs = CreateObject("Scripting.FileSystemObject"
strFtpScriptFileName = fs.BuildPath(fs.GetSpecialFolder(TemporaryFolder), fs.GetBaseName(Wscript.ScriptFullName) & ".script"
strRemoteSite = "myServer"
intWindowStyle = WshMaximizedNoFocus
FolderPath = cdDrive
Set objFolder = fs.GetFolder(FolderPath)
Set objFolder_Contain = objFolder.Files
For Each foundFile In objFolder_Contain
strFilename = cdDrive & "\" & foundFile.name
'********************************************************************************
'Checking data with MsgBox
MsgBox "File from cd rom: " & strFilename
MsgBox "From Form: " & strUsrN & "\" & strPssW & "\" & cdDrive
'********************************************************************************
Set tsScript = fs.CreateTextFile(strFtpScriptFileName, True)
tsScript.WriteLine "open " & strRemoteSite
tsScript.WriteLine strUsrN
tsScript.WriteLine strPssW
tsScript.WriteLine "hash"
tsScript.WriteLine "ascii"
tsScript.WriteLine "put " & strFilename & " test1"
tsScript.WriteLine "bye"
tsScript.Close
Set tsScript = Nothing
If fs.FileExists(fs.GetSpecialFolder(1) & "\ftp.exe" Then
wsh.Run fs.GetSpecialFolder(1) & "\ftp.exe -s:""" & strFtpScriptFileName & """", intWindowStyle, True
Else
wsh.Run fs.GetSpecialFolder(0) & "\ftp.exe -s:""" & strFtpScriptFileName & """", intWindowStyle, True
End If
fs.DeleteFile strFtpScriptFileName
fs.DeleteFile strFiles, True
MsgBox "Upload Completed!"
Set fs = Nothing
Next
End Sub
</script>
<FORM id="frmGetInfo">
<p align="center"><b><font face="Tahoma" size="6" color="#000080"><var><em><span style="letter-spacing: 3"><u>Financial
Institution Data Match (FIDM)</u></span></em></var></font></b></p>
<p align="center"><font color="#FF0000"><i>File Extract for the Texas Child
Support Enforcement Program</i></font></p>
<hr color="#000080">
<p align="left"><font color="#FF0000"><i>Enter Username/Password that you use
for Silverlake access.</i></font></p>
<p align="left">Username:<input id="txtName" type="text" size="20"></p>
<p align="left">Password:<input id="txtPass" type="password" size="20"></p>
<p align="left">CDRom Drive Letter<input id="cdDrive" type="text" size="2"></p>
<p align="left"><input id="runFIDM" type="button" value="Submit">
<input type="button" value="Continue" name="B1"></p>
<hr color="#000080">
<p align="left">Once completed you must do the following steps before selecting
continue.</p>
</form>
</body>
</html>
<body>
<SCRIPT LANGUAGE="VBScript">
Sub runFIDM_onClick()
On Error Resume Next
Dim wsh
Dim tsScript
Dim fs
Dim strRemoteSite
Dim strUsrN
Dim strPssW
Dim objFolder
Dim FolderPath
Dim objFolder_Contain
Dim foundFile
Dim strFilename
Dim cdDrive
Dim intWindowStyle
Dim strFtpScriptFileName
Const TemporaryFolder = 2
Const WshHide = 0
Const WshNormalFocus = 1
Const WshMinimizedFocus = 2
Const WshMaximizedNoFocus = 3
Const WshNormalNoFocus = 4
Const WshMinimizedNoFocus = 6
'*******************************************************************************
'Retreiving values from form(id=frmGetInfo)
strUsrN = frmGetInfo.txtName.value
strPssW = frmGetInfo.txtPass.value
cdDrive = frmGetInfo.cdDrive.value
'*******************************************************************************
Set wsh = CreateObject("Wscript.Shell"
Set fs = CreateObject("Scripting.FileSystemObject"
strFtpScriptFileName = fs.BuildPath(fs.GetSpecialFolder(TemporaryFolder), fs.GetBaseName(Wscript.ScriptFullName) & ".script"
strRemoteSite = "myServer"
intWindowStyle = WshMaximizedNoFocus
FolderPath = cdDrive
Set objFolder = fs.GetFolder(FolderPath)
Set objFolder_Contain = objFolder.Files
For Each foundFile In objFolder_Contain
strFilename = cdDrive & "\" & foundFile.name
'********************************************************************************
'Checking data with MsgBox
MsgBox "File from cd rom: " & strFilename
MsgBox "From Form: " & strUsrN & "\" & strPssW & "\" & cdDrive
'********************************************************************************
Set tsScript = fs.CreateTextFile(strFtpScriptFileName, True)
tsScript.WriteLine "open " & strRemoteSite
tsScript.WriteLine strUsrN
tsScript.WriteLine strPssW
tsScript.WriteLine "hash"
tsScript.WriteLine "ascii"
tsScript.WriteLine "put " & strFilename & " test1"
tsScript.WriteLine "bye"
tsScript.Close
Set tsScript = Nothing
If fs.FileExists(fs.GetSpecialFolder(1) & "\ftp.exe" Then
wsh.Run fs.GetSpecialFolder(1) & "\ftp.exe -s:""" & strFtpScriptFileName & """", intWindowStyle, True
Else
wsh.Run fs.GetSpecialFolder(0) & "\ftp.exe -s:""" & strFtpScriptFileName & """", intWindowStyle, True
End If
fs.DeleteFile strFtpScriptFileName
fs.DeleteFile strFiles, True
MsgBox "Upload Completed!"
Set fs = Nothing
Next
End Sub
</script>
<FORM id="frmGetInfo">
<p align="center"><b><font face="Tahoma" size="6" color="#000080"><var><em><span style="letter-spacing: 3"><u>Financial
Institution Data Match (FIDM)</u></span></em></var></font></b></p>
<p align="center"><font color="#FF0000"><i>File Extract for the Texas Child
Support Enforcement Program</i></font></p>
<hr color="#000080">
<p align="left"><font color="#FF0000"><i>Enter Username/Password that you use
for Silverlake access.</i></font></p>
<p align="left">Username:<input id="txtName" type="text" size="20"></p>
<p align="left">Password:<input id="txtPass" type="password" size="20"></p>
<p align="left">CDRom Drive Letter<input id="cdDrive" type="text" size="2"></p>
<p align="left"><input id="runFIDM" type="button" value="Submit">
<input type="button" value="Continue" name="B1"></p>
<hr color="#000080">
<p align="left">Once completed you must do the following steps before selecting
continue.</p>
</form>
</body>
</html>