Hello All!
I've gotten some great help here and I hope someone can come through for me (again!).
I'm trying to create a text file and set it to HIDDEN (Attributes =2). I've found several references on how to do it, but none of them seem to work. Here is my code. It works perfectly if I DON'T try to set the file attributes to HIDDEN.
Thanks,
TLogan
NOTE!!! Names have been changed to protect the innocent! Actual IP address and directories are correct in my code. For obvious reasons I have to mask them here. Also, the USER ID and Password are entered into an HTML form earlier in the script.
I've gotten some great help here and I hope someone can come through for me (again!).
I'm trying to create a text file and set it to HIDDEN (Attributes =2). I've found several references on how to do it, but none of them seem to work. Here is my code. It works perfectly if I DON'T try to set the file attributes to HIDDEN.
Thanks,
TLogan
NOTE!!! Names have been changed to protect the innocent! Actual IP address and directories are correct in my code. For obvious reasons I have to mask them here. Also, the USER ID and Password are entered into an HTML form earlier in the script.
Code:
'******************************************************
' create a hidden text file to use in the FTP procedure
Dim oFSo, scriptFile
Set oFSo = CreateObject("Scripting.FileSystemObject")
Set scriptFile = oFSo.CreateTextFile("C:\Temp\script.ftp")
[b] Set scriptFile.Attributes = 2 [/b]
'******************************************************
' Write to the script file for FTP down from site
scriptFile.writeline("USER " & strID)
scriptFile.writeline(strPassword)
scriptFile.writeline("cd TO/Some/New/directory/")
scriptFile.writeline("binary")
scriptFile.writeline("prompt n")
scriptFile.writeline("lcd " """C:/Temp/files""")
scriptFile.writeline("mget *.*")
scriptFile.writeline("quit")
scriptFile.close
Set Script=WScript.CreateObject("WScript.Shell")
Script.Run "ftp -n -s:script.ftp 99.99.99.99", 0, True
Wscript.Echo "Files Copied"
Script.Run "%COMSPEC% /c del c:\Temp\script.ftp /q/f",0,true
END SUB