Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

FTP Upload script vbs

I am unable to get this working, I have no idea why, I'm getting Error: Object required? anyone know why? thanks.

Code
Set oShell = CreateObject("Shell.Application")
Set objFSO = CreateObject("Scripting.FileSystemObject")
'Path to file or folder to upload
path = "C:\mydir\file.txt"
FTPUpload(path)
Sub FTPUpload(path)
On Error Resume Next
'Copy Options: 16 = Yes to All
Const copyType = 16
'FTP Wait Time in ms
waitTime = 80000
FTPUser = "CHANGE THIS TO UR FTP SERVER USERNAME"
FTPPass = "CHANGE THIS TO UR FTP PASSWORD"
FTPHost = "CHANGE THIS TO UR FTP SERVER NAME EG     server29.SPAM.com"
FTPDir = "/public_html"
strFTP = "ftp://" & FTPUser & ":" & FTPPass & "@" & FTPHost & FTPDir
Set objFTP = oShell.NameSpace(strFTP)
'Make new folder on FTP site
'objFTP.NewFolder "FTP Backup"
'Upload single file      
If objFSO.FileExists(path) Then
Set objFile = objFSO.getFile(path)
strParent = objFile.ParentFolder
Set objFolder = oShell.NameSpace(strParent)
Set objItem = objFolder.ParseName(objFile.Name)
objFTP.CopyHere objItem, copyType
End If
'Upload all files in folder
If objFSO.FolderExists(path) Then
'Code below can be used to upload entire folder
Set objFolder = oShell.NameSpace(path)
objFTP.CopyHere objFolder.Items, copyType
End If
If Err.Number <> 0 Then
Wscript.Echo "Error: " & Err.Description
End If
'Wait for upload
WScript.Sleep waitTime
End Sub
In what situation is this used?
Would VB.net or c# or even JS be an acceptable alternative? I don’t see the point of trying to mess with VBS
[Image: Syr3DlV.png]
(Feb 23, 2018 03:10 PM)gigajew Wrote:  Would VB.net or c# or even JS be an acceptable alternative? I don’t see the point of trying to mess with VBS

prolly skiddish stuff.
i take that as you do not have the knowledge to answer my question
(Feb 23, 2018 07:41 PM)anonCicero Wrote:  i take that as you do not have the knowledge to answer my question

Nor do you, which concludes that you did not even write the code in question.
[Image: Syr3DlV.png]
(Feb 23, 2018 08:04 PM)gigajew Wrote:  Nor do you, which concludes that you did not even write the code in question.

i never claimed to, which is why i made the thread
(Feb 23, 2018 07:41 PM)anonCicero Wrote:  i take that as you do not have the knowledge to answer my question

He asked you a question to help you and you didn't answer it and then you complain he doesn't have the knowledge. He literally tried to help you and you ignored it and then complained.
oh I didn't see, I apologize, js would be an acceptable option, sorry for my blatant rudeness and ignorance.
(Feb 23, 2018 03:10 PM)gigajew Wrote:  Would VB.net or c# or even JS be an acceptable alternative? I don’t see the point of trying to mess with VBS
(Feb 24, 2018 04:13 PM)anonCicero Wrote:  oh I didn't see, I apologize, js would be an acceptable option, sorry for my blatant rudeness and ignorance.

I was talking about this post:
(Feb 23, 2018 01:10 PM)Barret Wrote:  In what situation is this used?


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Shell] by HackooNov 24, 2021 11:20 PM 8 322 Nov 24, 2021 11:20 PM
Last Post: Louis Vuitton
[C] by gurlhackerclubAug 28, 2020 06:37 PM 5 198 Aug 28, 2020 06:37 PM
Last Post: gurlhackerclub
[Shell] by XMRFISHYJun 17, 2020 12:38 PM 1 132 Jun 17, 2020 12:38 PM
Last Post: Sajuuk