Login | |
|
 |
Re: FTP - 6/6/2005 9:57:12 AM
|
|
 |
|
| |
rockocubs
Posts: 65
Score: 0
Joined: 4/8/2005
From:
Status: offline
|
While the above script runs fine above when inserted in the html document as a sub it does not work get the scripting error as follows line: 29 char: 2 error: Object required 'WScript' code: 0 Any Ideas? <html><head> <link rel='stylesheet' href='ftp.css'> <title>Mainframe FTP 1.0</title></head> <script language="JavaScript"> <!-- hide function Login(form) { var username = form.username.value; var password = form.password.value; var server = form.server.value; var local = form.local.value; var remote = form.remote.value; FtpScript (username,password,server,local,remote); } // done hiding --> </script> <script type="text/vbscript"> Sub FtpScript (username,password,server,local,remote) Dim objFso Dim objShell Dim strInstructions Dim strHost Dim strUser Dim strPassword Dim strLocal Dim strRemote Set objFso = WScript.CreateObject("Scripting.FileSystemObject") Set objShell = WScript.CreateObject("WScript.Shell") strInstructions = "H:\Instructions.txt" strHost = server strUser = username strPassword = password strLocal = local strrRemote = remote With objFso With .CreateTextFile(strInstructions, True) .Writeline "lcd cd.." .Writeline "lcd " & strLocal .WriteLine "open " & strHost .WriteLine "user " & strUser .WriteLine strPassword .WriteLine "cd .." .WriteLine "cd " & strRemote .WriteLine "mget wea* wea*.txt" .WriteLine "close" .WriteLine "quit" .Close End With objShell.run "%windir%\system32\ftp.exe -i -n -s:" & strInstructions, 1, True .DeleteFile strInstructions End With End Sub </script> <body bgcolor='#ffffff'> <br><font class='title'><b>Mainframe FTP 1.0</b></font><hr> <p><table border='0' cellpadding='0' cellspacing='1' align='center' width='98%'><form name=login> <tr><td class='brgtcell' align='right'> Username </td> <td class='darkcell'> <input type='text' name='username' value='' size='20' maxlength='20'> </td></tr> <tr><td class='brgtcell' align='right'> Password </td> <td class='darkcell'> <input type='password' name='password' value='' size='20' maxlength='20'> </td></tr> <tr><td class='brgtcell' align='right'> Server </td> <td class='darkcell'> <input type='text' name='server' value='' size='60' maxlength='120'> </td></tr> <tr><td class='brgtcell' align='right'> Local </td> <td class='darkcell'> <input type='text' name='local' value='h:\' size='60' maxlength='200'> </td></tr> <tr><td class='brgtcell' align='right'> Remote </td> <td class='darkcell'> <input type='text' name='remote' value='' size='60' maxlength='200'> </td></tr> </table> <hr><table border='0' cellpadding='0' cellspacing='0' width='100%'><tr> <td align='right'><input style='color:#000000' type='button' value='Connect' onClick='Login(this.form)'></td> </tr></form></table> </body></html>
|
|
| |
|
|
|
 |
Re: FTP - 6/6/2005 11:08:01 AM
|
|
 |
|
| |
TNO
Posts: 1397
Score: 16
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
|
Lower your browser security settings or put your code in an hta
|
|
| |
|
|
|
|
|