Skip Navigation Links



File Upload and Download Automation

Author : Babu Dhinakaran S      Blog :Linuxos4all      Date: 3/5/2012 7:34:00 AM


Set oFTPScriptFSO = CreateObject("Scripting.FileSystemObject")
Set oFTPScriptShell = CreateObject("WScript.Shell")

upFileName = "C:\Users\n1009932\Desktop\test.txt"
UserName = "Customer_name"
Password = "welcome123"
GateWayServer = "prepb2bgw01.jdadelivers.com"

sUpldCmd = """c:\Program Files (x86)\WinSCP\WinSCP.com"" -script=" & "C:\Users\n1009932\Desktop\upldfile.txt"
sDwnldCmd = """c:\Program Files (x86)\WinSCP\WinSCP.com"" -script=" & "C:\Users\n1009932\Desktop\dwnldfile.txt"
'WScript.Echo "run Command: " & sCmd
sReturn = oFTPScriptShell.Run(sUpldCmd,3,true)

'WScript.Echo "Run Return Value: " & sOut

Wscript.Sleep 1000

'Delete the file once it is uploaded.
If ( sReturn = 1) Then
If (oFTPScriptFSO.FileExists("C:\Users\n1009932\Desktop\test.txt")) Then
oFTPScriptFSO.DeleteFile("C:\Users\n1009932\Desktop\test.txt")
Else
'unable to delete the file Uploaded File
WScript.Quit (1)
End If
End If
sReturn = 0
'procedures to download the file and delete after that.
sReturn = oFTPScriptShell.Run(sDwnldCmd,3,true)
WScript.Sleep 1000

If ( sReturn = 1) Then
If (oFTPScriptFSO.FileExists("C:\Users\n1009932\Desktop\test.txt")) Then
WScript.Quit (0)
Else
'File hasn't downloaded, check manually.
WScript.Quit (2)
End If
End If

Set oFTPScriptShell = Nothing
Set oFTPScriptFSO = Nothing

Bloggers

active bloggers in the last 24 hrs. Number shown in the bracket represents number of posts published in past 24 hrs,


other authors(74)

Fidarose Isha(3)

N.GURURAJ.(3)

ravi dabas(3)

sankarshan(3)

Ambica Srimal(2)

AMJAD KHAN(2)

Deepak(2)

Firoze Shakir Photographerno1(2)

Praveen Battula(2)

R.D. Bhalekar(2)

Rakesh HP(2)

Raksha(2)

Sameena Prathap(2)

Srinivasan Sampathkumar(2)

Vashi Chandiramani(2)

Aarthi(1)

Aathira Nair(1)

Anil(1)

Anu Lal(1)

Anu Varma(1)

Anuradha Goyal(1)

Aparna(1)

Aparna(1)

Archana Kumar(1)

aseemrastogi2(1)

Ashwini Kumar(1)

Beyond(1)

Bombay Chowparty(1)

Champa(1)

Chandrika Shubham(1)

churumuri(1)

churumuri(1)

Cynthia Z(1)

Deeps(1)

Devi(1)

Dew(1)

Divya Kudua(1)

Dr.K.P.R.RAJA(1)

Erin W.(1)

Garfield Dsouza(1)

Harimohan(1)

Harini Padmanabhan(1)

harish p i(1)

Hemu(1)

Ibrahim(1)

IS(1)

Iti(1)

Jean(1)

Kaveri Venkatesh(1)

Krithi Karthi(1)

Kumar Harsheet Raj(1)

Kunal Singh(1)

Love Baronia(1)

Madhavi Madhurakavi(1)

mahima(1)

Manreet Sodhi Someshwar(1)

Meena(1)

Megha Sarin(1)

mêlée(1)

MUNZ TDT(1)

Mythreyi(1)

Nagendra Bharathi(1)

Nandana(1)

Neelam Dadhwal(1)

Neeraja(1)

Nisha(1)

Nona(1)

nourishncherish(1)

Nupur(1)

palash ranjan khound(1)

parth joshi(1)

pinksocks(1)

Pradeep Chakraborty(1)

Pranshu(1)

Prasanta Bora(1)

Preety(1)

Priyadarshi Mishra(1)

Raafay Awan(1)

Raja(1)

Rams(1)

rhythmnguitars(1)

Ritesh Agarwal(1)

Ritu(1)

RWABhagidari.blogspot.com(1)

saketvaani(1)

Sameena Prathap(1)

Sampada(1)

Sandhya(1)

Santhosh Sivarajan(1)

Sayantani(1)

sayedkhadri(1)

Shankha(1)

Shobha(1)

Shobhaa De(1)

Smi..(1)

Sneo(1)

Sravs(1)

Sree(1)

Sreedhar Jeshurun(1)

Sriram Khé(1)

Sudharsan Narayanan(1)

Sujoy Das(1)

Team G Square(1)

the blogger formerly known as sansmerci(1)

The Guy in the Hat ™(1)

unmanagedexe(1)

Vaishali(1)

vanya(1)

Vikram Karve(1)

VJ Sharma(1)


garland of Languages of India
an amalgamation of the diversified traditions
gracefully presented with novelty
http://www.haaram.com