Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Secure Site?

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,3166
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Secure Site?
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Secure Site? - 5/30/2005 12:37:58 PM   
  TNO


Posts: 1397
Score: 16
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
The following script was designed to copy a group of files daily from a secure website, when its run I'm told that the files are not found. Is this due to the fact that this is https://? How can I work around this? The site requests Identification but its not required. Is there a way to attach a signature or some alternative?

Set fso = CreateObject("Scripting.FileSystemObject")
set WshShell = WScript.CreateObject("WScript.Shell")
dim MAL,LUBF,FLUBF,TE,CMR,DOCDEMAND,DASFFSN,STOCKDEMAND,RUDEMAND,DASFDOC,File,fldr,subfldr,dest,DiffADate,Julian,strDesktop

'Julian Date
DiffADate = DateDiff("d", "1-Jan-" & Year(Now), Now)
Julian = Right(Year(Now),1) & DiffADate + 1

'//////////////////////////////////////////////////////////////////////////////////////
'Create Folder on Desktop "Reports/Julian Date/

strDesktop = WshShell.SpecialFolders("Desktop")
fldr = strDesktop & "\Reports"
subfldr = strDesktop & "\Reports\" & Julian

If Not fso.FolderExists(fldr) Then
fso.CreateFolder(fldr)
End If
If Not fso.FolderExists(subfldr) Then
fso.CreateFolder(subfldr)
End If
'/////////////////////////////////////////////////////////////////////////////////////////

MAL = "https:\\"
LUBF = "https:\\"
FLUBF = "https:\\"
TE = "https:\\"
CMR = "\\Hqbnw2p019\"
DOCDEMAND = "https:\\"
DASFFSN = "https:\\"
STOCKDEMAND = "https:\\"
RUDEMAND = "https:\\"
DASFDOC = "https:\\"

'//////////////////////////////////////////////////////////////////////////////////////
'Make sure Files Exist
Function NoFile(File)
WScript.echo "File: " & File & " Not Found!"
WScript.quit
End Function

If Not fso.FileExists(CMR) Then
NoFile(CMR)
ElseIf Not fso.FileExists(LUBF) Then
NoFile(LUBF)
ElseIf Not fso.FileExists(FLUBF) Then
NoFile(FLUBF)
ElseIf Not fso.FileExists(TE) Then
NoFile(TE)
ElseIf Not fso.FileExists(MAL) Then
NoFile(MAL)
ElseIf Not fso.FileExists(DOCDEMAND) Then
NoFile(DOCDEMAND)
ElseIf Not fso.FileExists(DASFFSN) Then
NoFile(DASFFSN)
ElseIf Not fso.FileExists(STOCKDEMAND) Then
NoFile(STOCKDEMAND)
ElseIf Not fso.FileExists(RUDEMAND) Then
NoFile(RUDEMAND)
ElseIf Not fso.FileExists(DASFDOC) Then
NoFile(DASFDOC)
Else
Wscript.echo "An unknown error has occurred."
WScript.quit
End If
'//////////////////////////////////////////////////////////////////////////////////////
'Copy Files into Folder
With fso.CopyFile
MAL, subfldr,True
LUBF, subfldr,True
FLUBF, subfldr,True
TE, subfldr,True
CMR, subfldr,True
DOCDEMAND, subfldr,True
DASFFSN, subfldr,True
STOCKDEMAND, subfldr,True
RUDEMAND, subfldr,True
DASFDOC, subfldr,True
End With
'//////////////////////////////////////////////////////////////////////////////////////
WScript.quit

_____________________________

To iterate is human, to recurse divine. -- L. Peter Deutsch
 
 
Post #: 1
 
 Re: Secure Site? - 5/31/2005 12:41:31 AM   
  drbelden

 

Posts: 109
Score: 0
Joined: 12/21/2004
From: USA
Status: offline
I could be wrong, but I'm pretty sure you can't bind to files on a web site in the manner you are attempting to do it. Fileexists is always going to return that there are none because you aren't actually managing to get a recongized location.

(in reply to TNO)
 
 
Post #: 2
 
 Re: Secure Site? - 6/1/2005 12:24:50 PM   
  TNO


Posts: 1397
Score: 16
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
Hmm, ok then. What would the basic syntax be to copy a file from a website? Is there a method in the FileSystemObject for this?

(in reply to TNO)
 
 
Post #: 3
 
 Re: Secure Site? - 6/1/2005 4:47:27 PM   
  TNO


Posts: 1397
Score: 16
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
I've just recently come across the MSXML2.XMLHTTP object. Does anyone have a good reference site for this subject in relation to my question?

(in reply to TNO)
 
 
Post #: 4
 
 Re: Secure Site? - 6/1/2005 10:18:36 PM   
  TNO


Posts: 1397
Score: 16
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
I've tried pursuing the following method for downloading a file, but am coming across some difficulties, any suggestions?

Dim wsh, fso, ts
Const TEMP_FILE = "C:\~temp.wsf"
Set wsh = CreateObject("Wscript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso.OpenTextFile(TEMP_FILE, 2, True)
ts.WriteLine "<job>"
ts.WriteLine "<script language=""vbscript"" "
ts.WriteLine "src=""http://www.ericphelps.com/image/logo1.gif""/>"
ts.WriteLine "</job>"
ts.Close
wsh.Run "cscript.exe " & TEMP_FILE, 0, True
fso.DeleteFile TEMP_FILE

(in reply to TNO)
 
 
Post #: 5
 
 Re: Secure Site? - 6/2/2005 5:13:43 AM   
  drbelden

 

Posts: 109
Score: 0
Joined: 12/21/2004
From: USA
Status: offline
If I may ask, how do you download these if you do it manually? Do you browse to a page and then there is links on the page for the files you want to download and you click them and save? Is this your webserver or one you don't have control over? Just trying to get some details to see if I can figure out a way to help. If you already know the nomenclature of the files you may be able to point to them directly by automating your web browser.

(in reply to TNO)
 
 
Post #: 6
 
 Re: Secure Site? - 6/2/2005 10:54:26 AM   
  TNO


Posts: 1397
Score: 16
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
These files are on a government Logistics site. I have no control over these files. With a web browser I navigate straight to the file. I'm prompted with a request for identification https:// but none is required.

(in reply to TNO)
 
 
Post #: 7
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Secure Site? Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts