‎05-03-2012 05:54 PM
‎05-10-2012 10:36 PM
‎05-10-2012 10:26 PM
WshShell.Run "%comspec% /c ftp -s:C:\Lansweeper\ftpput.txt > C:\Lansweeper\results.txt",0
‎05-10-2012 08:44 PM
open someftpsite.com
<insert ftp username>
<insert ftp password>
put "c:\lansweeper\depot\*.txt"
quit
'=================================================================================
' lspushclient
' vbScript
' Written by Sal
' 12/14/2011
'=================================================================================
' Lansweeper Scan for Remote Clients
'=================================================================================
'Declare Stuffs
Dim WshShell
Set WshShell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
intLoopCount = 0
On Error Resume Next
'Run the lspushclient and dump the results into the depot folder
Set objExec = WshShell.Exec("""C:\Lansweeper\lspush.exe"" /folder ""C:\Lansweeper\depot""")
Do While objExec.Status <> 1
WScript.Sleep 250
Loop
'=================================================================================
'Upload File
FTP()
'Were done!
EndProgram()
'=================================================================================
'Start the FTP process
Sub FTP()
If intLoopCount = 5 Then
EndProgram()
End If
'Upload file and save the results
WshShell.Run "%comspec% /c ftp -s:C:\Lansweeper\ftpput.txt > C:\Lansweeper\results.txt"
WScript.Sleep 10000
Set textFile = objFSO.OpenTextFile("C:\Lansweeper\results.txt",1,0,-2)
strResults = textFile.ReadAll
textFile.close
Set textFile = Nothing
'Check the results for a success
If InStr(strResults, "226") > 0 Then
'Delete the Results file after the FTP process is done
objFSO.DeleteFile "C:\Lansweeper\depot\*.txt"
objFSO.DeleteFile "C:\Lansweeper\results.txt"
Else
'Wait 60 seconds and retry the FTP Process
WScript.Sleep 60000
intLoopCount = intLoopCount + 1
FTP()
End If
End Sub
'=================================================================================
'Lets clean up and get out
Sub EndProgram()
On Error Goto 0
Set WshShell = Nothing
WScript.Quit
End Sub
'=================================================================================
'
' END OF PROGRAM
'
'=================================================================================
‎05-10-2012 10:09 AM
‎05-08-2012 06:05 PM
‎05-08-2012 05:10 PM
‎05-08-2012 12:55 PM
‎05-03-2012 06:26 PM
‎05-03-2012 06:20 PM
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now