Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using scr file in VISTA for FTP ? 1

Status
Not open for further replies.

hovercraft

Technical User
Jun 19, 2006
236
US
Greetings,

I have been using this code in XP & AC2002 with out problems. When I put it on a VISTA machine with AC2007, I see the command prompt open, then close and the script is not executed.

I think VISTA is trying to run it as a screen saver even though ftp.exe is called. Any ideas as to what I need to change in order to use this with vista ... or perhaps it's a 2007 issue?

Code:
'******* Code Start *****
'This code was originally written by Dev Ashish
'It is not to be altered or distributed,
'except as part of an application.
'You are free to use it in any application,
'provided the copyright notice is left unchanged.
'
'Code Courtesy of
'Dev Ashish
'
Sub sFTP(stSCRFile As String)
'Usage Example:
'   call sFTP("C:\temp\test.scr")
'Sample SCR File for NT/Win95 FTP
'   lcd "c:\temp"
'   open ftp.someserver.com
'   anonymous
'   dash10@hotmail.com
'   cd public
'   binary
'   get dead.letter dead.letter
'   bye

Dim stSysDir As String
    stSysDir = Environ$("COMSPEC")
    stSysDir = Left$(stSysDir, Len(stSysDir) - Len(Dir(stSysDir)))
    Call Shell(stSysDir & "ftp.exe -s:" & stSCRFile, vbNormalFocus)
End Sub
'********** Code End *******

Thanks,
Hovercraft
 
What about this ?
Call Shell(stSysDir & " /C ftp.exe -s:" & stSCRFile, vbNormalFocus)

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks PHV, I'll give that a go.

Is that the DOS Choice switch being used?
 
PHV,

I've tried your suggestion but received an error. Which error, I forget. I'm at home now. But I tried the original .scr file and it works as long as 1) the script file is not located on the local machine running vista (I.E. a shared drive) and 2) the file being retrieved from the ftp server is saved on the share.

If I try to run a .scr from the local machine it acts like it is trying to run by opening a command window but then shortly closes and nothing has happened.

Thanks for help(s)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top