Sign in to follow this  
Followers 0
Noobster24

Very Weird, In One Program It Isn't Working, But In Seperated Programs, It Works

7 posts in this topic

#1 ·  Posted (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 ( :think: ) ?

I use W0uter's FTP functions (http://www.autoitscript.com/forum/index.php?showtopic=12473&hl=)

Edited by Noobster24

Programs so far:Teh Serializer - Search for licenses for Nero - Windows - Office - Alcohol etc.

Share this post


Link to post
Share on other sites



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?

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

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 ( :think: ) ?

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.

Share this post


Link to post
Share on other sites

:think:

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.

Share this post


Link to post
Share on other sites

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 :(:think:

What should I do now?


Programs so far:Teh Serializer - Search for licenses for Nero - Windows - Office - Alcohol etc.

Share this post


Link to post
Share on other sites

#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)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0