Noobster24 Posted April 18, 2006 Share Posted April 18, 2006 (edited) I created a program that makes a txt-file (list.txt), the system processes (Ctrl Alt Delete) are written into the txt-file... Then the file should be uploaded to a FTP server This is my program to create the txt-file: #include <File.au3> Opt("WinTitleMatchMode", 2) Opt("GUICloseOnESC", 1) Opt("TrayIconHide", 1) $dir = @ScriptDir $filec = _FileCreate("list.txt") $file = FileOpen("list.txt", 1) $list = ProcessList() for $i = 1 to $list[0][0] FileWrite($file, $list[$i][0] & @CRLF) next This is my program to upload the txt-file to the ftp-server #include <FTP.au3> Opt("TrayIconHide", 1) $dir = @ScriptDir $server = 'ftp.***.nl' $username = '**@***.nl' $pass = '***' $Open = _FTPOpen('MyFTP Control') $Conn = _FTPConnect($Open, $server, $username, $pass) $Ftpp = _FTPPutFile($Conn, $dir & '\list.txt', '/List/list.txt') $Ftpc = _FTPClose($Open) When I execute the programs like this, it works fine But when I add the source of the FTP uploading script to the program that makes the txt-file, it isn't working anymore, the file isn't uploaded It looks like this then: #include <File.au3> #include <FTP.au3> Opt("WinTitleMatchMode", 2) Opt("GUICloseOnESC", 1) Opt("TrayIconHide", 1) $dir = @ScriptDir $filec = _FileCreate("list.txt") $file = FileOpen("list.txt", 1) $list = ProcessList() for $i = 1 to $list[0][0] FileWrite($file, $list[$i][0] & @CRLF) next $dir = @ScriptDir $server = 'ftp.***.nl' $username = '**@***.nl' $pass = '***' $Open = _FTPOpen('MyFTP Control') $Conn = _FTPConnect($Open, $server, $username, $pass) $Ftpp = _FTPPutFile($Conn, $dir & '\list.txt', '/List/list.txt') $Ftpc = _FTPClose($Open) Why isn't the file uploaded with the All-In-One program ( ) ? I use W0uter's FTP functions (http://www.autoitscript.com/forum/index.php?showtopic=12473&hl=) Edited April 18, 2006 by Noobster24 Programs so far:Teh Serializer - Search for licenses for Nero - Windows - Office - Alcohol etc. Link to comment Share on other sites More sharing options...
Confuzzled Posted April 20, 2006 Share Posted April 20, 2006 I haven't looked at your code too closely, but just guessing. Maybe some of the variable names were re-used between your code and the #includes? Have you checked for error/return codes and variable values while debugging? Does the contents of 'list.txt' have valid data? Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted April 20, 2006 Share Posted April 20, 2006 idk if its a problem but u defined the same variable twice, im going to bed but it seems to be fine by the looks of it, im just curious as to wear ur making the text file? just quickly simplified ur script a lil going to bed #include <File.au3> #include <FTP.au3> Opt("WinTitleMatchMode", 2) Opt("GUICloseOnESC", 1) Opt("TrayIconHide", 1) $filec = _FileCreate(@ScriptDir & "\list.txt") $file = FileOpen($filec, 1) $list = ProcessList() for $i = 1 to $list[0][0] FileWrite($file, $list[$i][0] & @CRLF) next $server = 'ftp.***.nl' $username = '**@***.nl' $pass = '***' $Open = _FTPOpen('MyFTP Control') $Conn = _FTPConnect($Open, $server, $username, $pass) $Ftpp = _FTPPutFile($Conn, @ScriptDir & '\list.txt', '/List/list.txt') $Ftpc = _FTPClose($Open) Link to comment Share on other sites More sharing options...
Noobster24 Posted April 20, 2006 Author Share Posted April 20, 2006 I created a program that makes a txt-file (list.txt), the system processes (Ctrl Alt Delete) are written into the txt-file... Then the file should be uploaded to a FTP server This is my program to create the txt-file: #include <File.au3> Opt("WinTitleMatchMode", 2) Opt("GUICloseOnESC", 1) Opt("TrayIconHide", 1) $dir = @ScriptDir $filec = _FileCreate("list.txt") $file = FileOpen("list.txt", 1) $list = ProcessList() for $i = 1 to $list[0][0] FileWrite($file, $list[$i][0] & @CRLF) next This is my program to upload the txt-file to the ftp-server #include <FTP.au3> Opt("TrayIconHide", 1) $dir = @ScriptDir $server = 'ftp.***.nl' $username = '**@***.nl' $pass = '***' $Open = _FTPOpen('MyFTP Control') $Conn = _FTPConnect($Open, $server, $username, $pass) $Ftpp = _FTPPutFile($Conn, $dir & '\list.txt', '/List/list.txt') $Ftpc = _FTPClose($Open) When I execute the programs like this, it works fine But when I add the source of the FTP uploading script to the program that makes the txt-file, it isn't working anymore, the file isn't uploaded It looks like this then: #include <File.au3> #include <FTP.au3> Opt("WinTitleMatchMode", 2) Opt("GUICloseOnESC", 1) Opt("TrayIconHide", 1) $dir = @ScriptDir $filec = _FileCreate("list.txt") $file = FileOpen("list.txt", 1) $list = ProcessList() for $i = 1 to $list[0][0] FileWrite($file, $list[$i][0] & @CRLF) next $dir = @ScriptDir $server = 'ftp.***.nl' $username = '**@***.nl' $pass = '***' $Open = _FTPOpen('MyFTP Control') $Conn = _FTPConnect($Open, $server, $username, $pass) $Ftpp = _FTPPutFile($Conn, $dir & '\list.txt', '/List/list.txt') $Ftpc = _FTPClose($Open) Why isn't the file uploaded with the All-In-One program ( ) ? I use W0uter's FTP functions (http://www.autoitscript.com/forum/index.php?showtopic=12473&hl=) Yes, it's all valid data, the list.txt is fine, and all the System Processes are listed (written) into the txt-file... Programs so far:Teh Serializer - Search for licenses for Nero - Windows - Office - Alcohol etc. Link to comment Share on other sites More sharing options...
Noobster24 Posted April 20, 2006 Author Share Posted April 20, 2006 idk if its a problem but u defined the same variable twice, im going to bed but it seems to be fine by the looks of it, im just curious as to wear ur making the text file? just quickly simplified ur script a lil going to bed #include <File.au3> #include <FTP.au3> Opt("WinTitleMatchMode", 2) Opt("GUICloseOnESC", 1) Opt("TrayIconHide", 1) $filec = _FileCreate(@ScriptDir & "\list.txt") $file = FileOpen($filec, 1) $list = ProcessList() for $i = 1 to $list[0][0] FileWrite($file, $list[$i][0] & @CRLF) next $server = 'ftp.***.nl' $username = '**@***.nl' $pass = '***' $Open = _FTPOpen('MyFTP Control') $Conn = _FTPConnect($Open, $server, $username, $pass) $Ftpp = _FTPPutFile($Conn, @ScriptDir & '\list.txt', '/List/list.txt') $Ftpc = _FTPClose($Open) Thanks for updating the script, I'm at school now, when I get home, I will test it... Programs so far:Teh Serializer - Search for licenses for Nero - Windows - Office - Alcohol etc. Link to comment Share on other sites More sharing options...
Noobster24 Posted April 23, 2006 Author Share Posted April 23, 2006 idk if its a problem but u defined the same variable twice, im going to bed but it seems to be fine by the looks of it, im just curious as to wear ur making the text file? just quickly simplified ur script a lil going to bed #include <File.au3> #include <FTP.au3> Opt("WinTitleMatchMode", 2) Opt("GUICloseOnESC", 1) Opt("TrayIconHide", 1) $filec = _FileCreate(@ScriptDir & "\list.txt") $file = FileOpen($filec, 1) $list = ProcessList() for $i = 1 to $list[0][0] FileWrite($file, $list[$i][0] & @CRLF) next $server = 'ftp.***.nl' $username = '**@***.nl' $pass = '***' $Open = _FTPOpen('MyFTP Control') $Conn = _FTPConnect($Open, $server, $username, $pass) $Ftpp = _FTPPutFile($Conn, @ScriptDir & '\list.txt', '/List/list.txt') $Ftpc = _FTPClose($Open) The script isn't working What should I do now? Programs so far:Teh Serializer - Search for licenses for Nero - Windows - Office - Alcohol etc. Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted April 23, 2006 Share Posted April 23, 2006 #include <File.au3> #include <FTP.au3> #NoTrayIcon Opt("WinTitleMatchMode", 2) Opt("GUICloseOnESC", 1) $filec = _FileCreate(@ScriptDir & "\list.txt") $file = FileOpen($filec, 1) $list = ProcessList() for $i = 1 to $list[0][0] FileWrite(@ScriptDir & "\list.txt",$list[$i][0] & @CRLF) next $server = 'ftp.***.nl' $username = '**@***.nl' $pass = '***' $Open = _FTPOpen('MyFTP Control') $Conn = _FTPConnect($Open, $server, $username, $pass) $Ftpp = _FTPPutFile($Conn, @ScriptDir & '\list.txt', '/List/list.txt') $Ftpc = _FTPClose($Open) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now