Option Explicit Dim objFSO, objFolder, objShell, strDirectory WScript.echo "install starting" strDirectory = "c:\metatrader" Set objFSO = CreateObject("Scripting.FileSystemObject") If objFSO.FolderExists(strDirectory) Then Set objFolder = objFSO.GetFolder(strDirectory) Else Set objFolder = objFSO.CreateFolder(strDirectory) End If If err.number = vbEmpty then Set objShell = CreateObject("WScript.Shell") Else WScript.echo "VBScript Error: " & err.number End If strDirectory = "c:\metatrader\trade_copy" Set objFSO = CreateObject("Scripting.FileSystemObject") If objFSO.FolderExists(strDirectory) Then Set objFolder = objFSO.GetFolder(strDirectory) Else Set objFolder = objFSO.CreateFolder(strDirectory) End If If err.number = vbEmpty then Set objShell = CreateObject("WScript.Shell") Else WScript.echo "VBScript Error: " & err.number End If strDirectory = "c:\metatrader\trade_sender" Set objFSO = CreateObject("Scripting.FileSystemObject") If objFSO.FolderExists(strDirectory) Then Set objFolder = objFSO.GetFolder(strDirectory) Else Set objFolder = objFSO.CreateFolder(strDirectory) End If If err.number = vbEmpty then Set objShell = CreateObject("WScript.Shell") Else WScript.echo "VBScript Error: " & err.number End If strDirectory = "c:\metatrader\trade_copy\experts" Set objFSO = CreateObject("Scripting.FileSystemObject") If objFSO.FolderExists(strDirectory) Then Set objFolder = objFSO.GetFolder(strDirectory) Else Set objFolder = objFSO.CreateFolder(strDirectory) End If If err.number = vbEmpty then Else WScript.echo "VBScript Error: " & err.number End If strDirectory = "c:\metatrader\trade_sender\experts" Set objFSO = CreateObject("Scripting.FileSystemObject") If objFSO.FolderExists(strDirectory) Then Set objFolder = objFSO.GetFolder(strDirectory) Else Set objFolder = objFSO.CreateFolder(strDirectory) End If If err.number = vbEmpty then Set objShell = CreateObject("WScript.Shell") Else WScript.echo "VBScript Error: " & err.number End If strDirectory = "c:\metatrader\trade_copy\experts\files" Set objFSO = CreateObject("Scripting.FileSystemObject") If objFSO.FolderExists(strDirectory) Then Set objFolder = objFSO.GetFolder(strDirectory) Else Set objFolder = objFSO.CreateFolder(strDirectory) End If If err.number = vbEmpty then Else WScript.echo "VBScript Error: " & err.number End If strDirectory = "c:\metatrader\trade_sender\experts\files" Set objFSO = CreateObject("Scripting.FileSystemObject") If objFSO.FolderExists(strDirectory) Then Set objFolder = objFSO.GetFolder(strDirectory) Else Set objFolder = objFSO.CreateFolder(strDirectory) End If If err.number = vbEmpty then Set objShell = CreateObject("WScript.Shell") Else WScript.echo "VBScript Error: " & err.number End If ' WScript.Quit HTTPDownload "http://trendchaser.comze.com/files/metatrader/trade_copy/experts/trade_copy.mq4", "C:\metatrader\trade_copy\experts" Sub HTTPDownload( myURL, myPath ) ' This Sub downloads the FILE specified in myURL to the path specified in myPath. ' ' myURL must always end with a file name ' myPath may be a directory or a file name; in either case the directory must exist ' ' Written by Rob van der Woude ' http://www.robvanderwoude.com ' ' Based on a script found on the Thai Visa forum ' http://www.thaivisa.com/forum/index.php?showtopic=21832 ' Standard housekeeping Dim i, objFile, objFSO, objHTTP, strFile, strMsg Const ForReading = 1, ForWriting = 2, ForAppending = 8 ' Create a File System Object Set objFSO = CreateObject( "Scripting.FileSystemObject" ) ' Check if the specified target file or folder exists, ' and build the fully qualified path of the target file If objFSO.FolderExists( myPath ) Then strFile = objFSO.BuildPath( myPath, Mid( myURL, InStrRev( myURL, "/" ) + 1 ) ) ElseIf objFSO.FolderExists( Left( myPath, InStrRev( myPath, "\" ) - 1 ) ) Then strFile = myPath Else WScript.Echo "ERROR: Target folder not found." Exit Sub End If ' Create or open the target file Set objFile = objFSO.OpenTextFile( strFile, ForWriting, True ) ' Create an HTTP object Set objHTTP = CreateObject( "WinHttp.WinHttpRequest.5.1" ) ' Download the specified URL objHTTP.Open "GET", myURL, False objHTTP.Send ' Write the downloaded byte stream to the target file For i = 1 To LenB( objHTTP.ResponseBody ) objFile.Write Chr( AscB( MidB( objHTTP.ResponseBody, i, 1 ) ) ) Next ' Close the target file objFile.Close( ) End Sub HTTPDownload "http://trendchaser.comze.com/files/metatrader/trade_sender/experts/trade_sender.mq4", "C:\metatrader\trade_sender\experts" Sub HTTPDownload( myURL, myPath ) ' This Sub downloads the FILE specified in myURL to the path specified in myPath. ' ' myURL must always end with a file name ' myPath may be a directory or a file name; in either case the directory must exist ' ' Written by Rob van der Woude ' http://www.robvanderwoude.com ' ' Based on a script found on the Thai Visa forum ' http://www.thaivisa.com/forum/index.php?showtopic=21832 ' Standard housekeeping Dim i, objFile, objFSO, objHTTP, strFile, strMsg Const ForReading = 1, ForWriting = 2, ForAppending = 8 ' Create a File System Object Set objFSO = CreateObject( "Scripting.FileSystemObject" ) ' Check if the specified target file or folder exists, ' and build the fully qualified path of the target file If objFSO.FolderExists( myPath ) Then strFile = objFSO.BuildPath( myPath, Mid( myURL, InStrRev( myURL, "/" ) + 1 ) ) ElseIf objFSO.FolderExists( Left( myPath, InStrRev( myPath, "\" ) - 1 ) ) Then strFile = myPath Else WScript.Echo "ERROR: Target folder not found." Exit Sub End If ' Create or open the target file Set objFile = objFSO.OpenTextFile( strFile, ForWriting, True ) ' Create an HTTP object Set objHTTP = CreateObject( "WinHttp.WinHttpRequest.5.1" ) ' Download the specified URL objHTTP.Open "GET", myURL, False objHTTP.Send ' Write the downloaded byte stream to the target file For i = 1 To LenB( objHTTP.ResponseBody ) objFile.Write Chr( AscB( MidB( objHTTP.ResponseBody, i, 1 ) ) ) Next ' Close the target file objFile.Close( ) End Sub HTTPDownload "http://trendchaser.comze.com/files/metatrader/check_update2.vbs", "C:\metatrader" Sub HTTPDownload( myURL, myPath ) ' This Sub downloads the FILE specified in myURL to the path specified in myPath. ' ' myURL must always end with a file name ' myPath may be a directory or a file name; in either case the directory must exist ' ' Written by Rob van der Woude ' http://www.robvanderwoude.com ' ' Based on a script found on the Thai Visa forum ' http://www.thaivisa.com/forum/index.php?showtopic=21832 ' Standard housekeeping Dim i, objFile, objFSO, objHTTP, strFile, strMsg Const ForReading = 1, ForWriting = 2, ForAppending = 8 ' Create a File System Object Set objFSO = CreateObject( "Scripting.FileSystemObject" ) ' Check if the specified target file or folder exists, ' and build the fully qualified path of the target file If objFSO.FolderExists( myPath ) Then strFile = objFSO.BuildPath( myPath, Mid( myURL, InStrRev( myURL, "/" ) + 1 ) ) ElseIf objFSO.FolderExists( Left( myPath, InStrRev( myPath, "\" ) - 1 ) ) Then strFile = myPath Else WScript.Echo "ERROR: Target folder not found." Exit Sub End If ' Create or open the target file Set objFile = objFSO.OpenTextFile( strFile, ForWriting, True ) ' Create an HTTP object Set objHTTP = CreateObject( "WinHttp.WinHttpRequest.5.1" ) ' Download the specified URL objHTTP.Open "GET", myURL, False objHTTP.Send ' Write the downloaded byte stream to the target file For i = 1 To LenB( objHTTP.ResponseBody ) objFile.Write Chr( AscB( MidB( objHTTP.ResponseBody, i, 1 ) ) ) Next ' Close the target file objFile.Close( ) End Sub HTTPDownload "http://trendchaser.comze.com/files/metatrader/check_update.vbs", "C:\metatrader" Sub HTTPDownload( myURL, myPath ) ' This Sub downloads the FILE specified in myURL to the path specified in myPath. ' ' myURL must always end with a file name ' myPath may be a directory or a file name; in either case the directory must exist ' ' Written by Rob van der Woude ' http://www.robvanderwoude.com ' ' Based on a script found on the Thai Visa forum ' http://www.thaivisa.com/forum/index.php?showtopic=21832 ' Standard housekeeping Dim i, objFile, objFSO, objHTTP, strFile, strMsg Const ForReading = 1, ForWriting = 2, ForAppending = 8 ' Create a File System Object Set objFSO = CreateObject( "Scripting.FileSystemObject" ) ' Check if the specified target file or folder exists, ' and build the fully qualified path of the target file If objFSO.FolderExists( myPath ) Then strFile = objFSO.BuildPath( myPath, Mid( myURL, InStrRev( myURL, "/" ) + 1 ) ) ElseIf objFSO.FolderExists( Left( myPath, InStrRev( myPath, "\" ) - 1 ) ) Then strFile = myPath Else WScript.Echo "ERROR: Target folder not found." Exit Sub End If ' Create or open the target file Set objFile = objFSO.OpenTextFile( strFile, ForWriting, True ) ' Create an HTTP object Set objHTTP = CreateObject( "WinHttp.WinHttpRequest.5.1" ) ' Download the specified URL objHTTP.Open "GET", myURL, False objHTTP.Send ' Write the downloaded byte stream to the target file For i = 1 To LenB( objHTTP.ResponseBody ) objFile.Write Chr( AscB( MidB( objHTTP.ResponseBody, i, 1 ) ) ) Next ' Close the target file objFile.Close( ) End Sub HTTPDownload "http://trendchaser.comze.com/files/metatrader/dl_trade_copier.vbs", "C:\metatrader" Sub HTTPDownload( myURL, myPath ) ' This Sub downloads the FILE specified in myURL to the path specified in myPath. ' ' myURL must always end with a file name ' myPath may be a directory or a file name; in either case the directory must exist ' ' Written by Rob van der Woude ' http://www.robvanderwoude.com ' ' Based on a script found on the Thai Visa forum ' http://www.thaivisa.com/forum/index.php?showtopic=21832 ' Standard housekeeping Dim i, objFile, objFSO, objHTTP, strFile, strMsg Const ForReading = 1, ForWriting = 2, ForAppending = 8 ' Create a File System Object Set objFSO = CreateObject( "Scripting.FileSystemObject" ) ' Check if the specified target file or folder exists, ' and build the fully qualified path of the target file If objFSO.FolderExists( myPath ) Then strFile = objFSO.BuildPath( myPath, Mid( myURL, InStrRev( myURL, "/" ) + 1 ) ) ElseIf objFSO.FolderExists( Left( myPath, InStrRev( myPath, "\" ) - 1 ) ) Then strFile = myPath Else WScript.Echo "ERROR: Target folder not found." Exit Sub End If ' Create or open the target file Set objFile = objFSO.OpenTextFile( strFile, ForWriting, True ) ' Create an HTTP object Set objHTTP = CreateObject( "WinHttp.WinHttpRequest.5.1" ) ' Download the specified URL objHTTP.Open "GET", myURL, False objHTTP.Send ' Write the downloaded byte stream to the target file For i = 1 To LenB( objHTTP.ResponseBody ) objFile.Write Chr( AscB( MidB( objHTTP.ResponseBody, i, 1 ) ) ) Next ' Close the target file objFile.Close( ) End Sub HTTPDownload "http://trendchaser.comze.com/files/metatrader/dl_trade_sender.vbs", "C:\metatrader" Sub HTTPDownload( myURL, myPath ) ' This Sub downloads the FILE specified in myURL to the path specified in myPath. ' ' myURL must always end with a file name ' myPath may be a directory or a file name; in either case the directory must exist ' ' Written by Rob van der Woude ' http://www.robvanderwoude.com ' ' Based on a script found on the Thai Visa forum ' http://www.thaivisa.com/forum/index.php?showtopic=21832 ' Standard housekeeping Dim i, objFile, objFSO, objHTTP, strFile, strMsg Const ForReading = 1, ForWriting = 2, ForAppending = 8 ' Create a File System Object Set objFSO = CreateObject( "Scripting.FileSystemObject" ) ' Check if the specified target file or folder exists, ' and build the fully qualified path of the target file If objFSO.FolderExists( myPath ) Then strFile = objFSO.BuildPath( myPath, Mid( myURL, InStrRev( myURL, "/" ) + 1 ) ) ElseIf objFSO.FolderExists( Left( myPath, InStrRev( myPath, "\" ) - 1 ) ) Then strFile = myPath Else WScript.Echo "ERROR: Target folder not found." Exit Sub End If ' Create or open the target file Set objFile = objFSO.OpenTextFile( strFile, ForWriting, True ) ' Create an HTTP object Set objHTTP = CreateObject( "WinHttp.WinHttpRequest.5.1" ) ' Download the specified URL objHTTP.Open "GET", myURL, False objHTTP.Send ' Write the downloaded byte stream to the target file For i = 1 To LenB( objHTTP.ResponseBody ) objFile.Write Chr( AscB( MidB( objHTTP.ResponseBody, i, 1 ) ) ) Next ' Close the target file objFile.Close( ) End Sub HTTPDownload "http://trendchaser.comze.com/files/metatrader/dl_trade_senderindy.vbs", "C:\metatrader" Sub HTTPDownload( myURL, myPath ) ' This Sub downloads the FILE specified in myURL to the path specified in myPath. ' ' myURL must always end with a file name ' myPath may be a directory or a file name; in either case the directory must exist ' ' Written by Rob van der Woude ' http://www.robvanderwoude.com ' ' Based on a script found on the Thai Visa forum ' http://www.thaivisa.com/forum/index.php?showtopic=21832 ' Standard housekeeping Dim i, objFile, objFSO, objHTTP, strFile, strMsg Const ForReading = 1, ForWriting = 2, ForAppending = 8 ' Create a File System Object Set objFSO = CreateObject( "Scripting.FileSystemObject" ) ' Check if the specified target file or folder exists, ' and build the fully qualified path of the target file If objFSO.FolderExists( myPath ) Then strFile = objFSO.BuildPath( myPath, Mid( myURL, InStrRev( myURL, "/" ) + 1 ) ) ElseIf objFSO.FolderExists( Left( myPath, InStrRev( myPath, "\" ) - 1 ) ) Then strFile = myPath Else WScript.Echo "ERROR: Target folder not found." Exit Sub End If ' Create or open the target file Set objFile = objFSO.OpenTextFile( strFile, ForWriting, True ) ' Create an HTTP object Set objHTTP = CreateObject( "WinHttp.WinHttpRequest.5.1" ) ' Download the specified URL objHTTP.Open "GET", myURL, False objHTTP.Send ' Write the downloaded byte stream to the target file For i = 1 To LenB( objHTTP.ResponseBody ) objFile.Write Chr( AscB( MidB( objHTTP.ResponseBody, i, 1 ) ) ) Next ' Close the target file objFile.Close( ) End Sub HTTPDownload "http://trendchaser.comze.com/files/metatrader/get_objects.vbs", "C:\metatrader" Sub HTTPDownload( myURL, myPath ) ' This Sub downloads the FILE specified in myURL to the path specified in myPath. ' ' myURL must always end with a file name ' myPath may be a directory or a file name; in either case the directory must exist ' ' Written by Rob van der Woude ' http://www.robvanderwoude.com ' ' Based on a script found on the Thai Visa forum ' http://www.thaivisa.com/forum/index.php?showtopic=21832 ' Standard housekeeping Dim i, objFile, objFSO, objHTTP, strFile, strMsg Const ForReading = 1, ForWriting = 2, ForAppending = 8 ' Create a File System Object Set objFSO = CreateObject( "Scripting.FileSystemObject" ) ' Check if the specified target file or folder exists, ' and build the fully qualified path of the target file If objFSO.FolderExists( myPath ) Then strFile = objFSO.BuildPath( myPath, Mid( myURL, InStrRev( myURL, "/" ) + 1 ) ) ElseIf objFSO.FolderExists( Left( myPath, InStrRev( myPath, "\" ) - 1 ) ) Then strFile = myPath Else WScript.Echo "ERROR: Target folder not found." Exit Sub End If ' Create or open the target file Set objFile = objFSO.OpenTextFile( strFile, ForWriting, True ) ' Create an HTTP object Set objHTTP = CreateObject( "WinHttp.WinHttpRequest.5.1" ) ' Download the specified URL objHTTP.Open "GET", myURL, False objHTTP.Send ' Write the downloaded byte stream to the target file For i = 1 To LenB( objHTTP.ResponseBody ) objFile.Write Chr( AscB( MidB( objHTTP.ResponseBody, i, 1 ) ) ) Next ' Close the target file objFile.Close( ) End Sub HTTPDownload "http://trendchaser.comze.com/files/metatrader/get_trades.vbs", "C:\metatrader" Sub HTTPDownload( myURL, myPath ) ' This Sub downloads the FILE specified in myURL to the path specified in myPath. ' ' myURL must always end with a file name ' myPath may be a directory or a file name; in either case the directory must exist ' ' Written by Rob van der Woude ' http://www.robvanderwoude.com ' ' Based on a script found on the Thai Visa forum ' http://www.thaivisa.com/forum/index.php?showtopic=21832 ' Standard housekeeping Dim i, objFile, objFSO, objHTTP, strFile, strMsg Const ForReading = 1, ForWriting = 2, ForAppending = 8 ' Create a File System Object Set objFSO = CreateObject( "Scripting.FileSystemObject" ) ' Check if the specified target file or folder exists, ' and build the fully qualified path of the target file If objFSO.FolderExists( myPath ) Then strFile = objFSO.BuildPath( myPath, Mid( myURL, InStrRev( myURL, "/" ) + 1 ) ) ElseIf objFSO.FolderExists( Left( myPath, InStrRev( myPath, "\" ) - 1 ) ) Then strFile = myPath Else WScript.Echo "ERROR: Target folder not found." Exit Sub End If ' Create or open the target file Set objFile = objFSO.OpenTextFile( strFile, ForWriting, True ) ' Create an HTTP object Set objHTTP = CreateObject( "WinHttp.WinHttpRequest.5.1" ) ' Download the specified URL objHTTP.Open "GET", myURL, False objHTTP.Send ' Write the downloaded byte stream to the target file For i = 1 To LenB( objHTTP.ResponseBody ) objFile.Write Chr( AscB( MidB( objHTTP.ResponseBody, i, 1 ) ) ) Next ' Close the target file objFile.Close( ) HTTPDownload "http://trendchaser.comze.com/files/metatrader/get_history.vbs", "C:\metatrader" Sub HTTPDownload( myURL, myPath ) ' This Sub downloads the FILE specified in myURL to the path specified in myPath. ' ' myURL must always end with a file name ' myPath may be a directory or a file name; in either case the directory must exist ' ' Written by Rob van der Woude ' http://www.robvanderwoude.com ' ' Based on a script found on the Thai Visa forum ' http://www.thaivisa.com/forum/index.php?showtopic=21832 ' Standard housekeeping Dim i, objFile, objFSO, objHTTP, strFile, strMsg Const ForReading = 1, ForWriting = 2, ForAppending = 8 ' Create a File System Object Set objFSO = CreateObject( "Scripting.FileSystemObject" ) ' Check if the specified target file or folder exists, ' and build the fully qualified path of the target file If objFSO.FolderExists( myPath ) Then strFile = objFSO.BuildPath( myPath, Mid( myURL, InStrRev( myURL, "/" ) + 1 ) ) ElseIf objFSO.FolderExists( Left( myPath, InStrRev( myPath, "\" ) - 1 ) ) Then strFile = myPath Else WScript.Echo "ERROR: Target folder not found." Exit Sub End If ' Create or open the target file Set objFile = objFSO.OpenTextFile( strFile, ForWriting, True ) ' Create an HTTP object Set objHTTP = CreateObject( "WinHttp.WinHttpRequest.5.1" ) ' Download the specified URL objHTTP.Open "GET", myURL, False objHTTP.Send ' Write the downloaded byte stream to the target file For i = 1 To LenB( objHTTP.ResponseBody ) objFile.Write Chr( AscB( MidB( objHTTP.ResponseBody, i, 1 ) ) ) Next ' Close the target file objFile.Close( ) End Sub HTTPDownload "http://trendchaser.comze.com/files/metatrader/restart_trade_copy.bat", "C:\metatrader" Sub HTTPDownload( myURL, myPath ) ' This Sub downloads the FILE specified in myURL to the path specified in myPath. ' ' myURL must always end with a file name ' myPath may be a directory or a file name; in either case the directory must exist ' ' Written by Rob van der Woude ' http://www.robvanderwoude.com ' ' Based on a script found on the Thai Visa forum ' http://www.thaivisa.com/forum/index.php?showtopic=21832 ' Standard housekeeping Dim i, objFile, objFSO, objHTTP, strFile, strMsg Const ForReading = 1, ForWriting = 2, ForAppending = 8 ' Create a File System Object Set objFSO = CreateObject( "Scripting.FileSystemObject" ) ' Check if the specified target file or folder exists, ' and build the fully qualified path of the target file If objFSO.FolderExists( myPath ) Then strFile = objFSO.BuildPath( myPath, Mid( myURL, InStrRev( myURL, "/" ) + 1 ) ) ElseIf objFSO.FolderExists( Left( myPath, InStrRev( myPath, "\" ) - 1 ) ) Then strFile = myPath Else WScript.Echo "ERROR: Target folder not found." Exit Sub End If ' Create or open the target file Set objFile = objFSO.OpenTextFile( strFile, ForWriting, True ) ' Create an HTTP object Set objHTTP = CreateObject( "WinHttp.WinHttpRequest.5.1" ) ' Download the specified URL objHTTP.Open "GET", myURL, False objHTTP.Send ' Write the downloaded byte stream to the target file For i = 1 To LenB( objHTTP.ResponseBody ) objFile.Write Chr( AscB( MidB( objHTTP.ResponseBody, i, 1 ) ) ) Next ' Close the target file objFile.Close( ) End Sub HTTPDownload "http://trendchaser.comze.com/files/metatrader/restart_trade_sender.bat", "C:\metatrader" Sub HTTPDownload( myURL, myPath ) ' This Sub downloads the FILE specified in myURL to the path specified in myPath. ' ' myURL must always end with a file name ' myPath may be a directory or a file name; in either case the directory must exist ' ' Written by Rob van der Woude ' http://www.robvanderwoude.com ' ' Based on a script found on the Thai Visa forum ' http://www.thaivisa.com/forum/index.php?showtopic=21832 ' Standard housekeeping Dim i, objFile, objFSO, objHTTP, strFile, strMsg Const ForReading = 1, ForWriting = 2, ForAppending = 8 ' Create a File System Object Set objFSO = CreateObject( "Scripting.FileSystemObject" ) ' Check if the specified target file or folder exists, ' and build the fully qualified path of the target file If objFSO.FolderExists( myPath ) Then strFile = objFSO.BuildPath( myPath, Mid( myURL, InStrRev( myURL, "/" ) + 1 ) ) ElseIf objFSO.FolderExists( Left( myPath, InStrRev( myPath, "\" ) - 1 ) ) Then strFile = myPath Else WScript.Echo "ERROR: Target folder not found." Exit Sub End If ' Create or open the target file Set objFile = objFSO.OpenTextFile( strFile, ForWriting, True ) ' Create an HTTP object Set objHTTP = CreateObject( "WinHttp.WinHttpRequest.5.1" ) ' Download the specified URL objHTTP.Open "GET", myURL, False objHTTP.Send ' Write the downloaded byte stream to the target file For i = 1 To LenB( objHTTP.ResponseBody ) objFile.Write Chr( AscB( MidB( objHTTP.ResponseBody, i, 1 ) ) ) Next ' Close the target file objFile.Close( ) End Sub WScript.echo "install finished"