Sign in to follow this  
Followers 0
nico666

Give Special Name To A File

10 posts in this topic

Hello.

I need to give The computer name to the name of the file in my ftp:

#include <FTP.au3>
$server = 'perso-ftp.wanadoo.fr'
$username = 'my.username'
$pass = 'mypass'

$Open = _FTPOpen('MyFTP Control')
$Conn = _FTPConnect($Open, $server, $username, $pass)
$Ftpp = _FtpPutFile($Conn, 'C:\test.txt', '/@ComputerName.txt') ; my problem is here :S
$Ftpc = _FTPClose($Open)

Can you help me please :think:

Share this post


Link to post
Share on other sites



Hello.

I need to give The computer name to the name of the file in my ftp:

#include <FTP.au3>
$server = 'perso-ftp.wanadoo.fr'
$username = 'my.username'
$pass = 'mypass'

$Open = _FTPOpen('MyFTP Control')
$Conn = _FTPConnect($Open, $server, $username, $pass)
$Ftpp = _FtpPutFile($Conn, 'C:\test.txt', '/@ComputerName.txt'); my problem is here :S
$Ftpc = _FTPClose($Open)

Can you help me please :think:

Not tested... but perhaps:

#include <FTP.au3>
$server = 'perso-ftp.wanadoo.fr'
$username = 'my.username'
$pass = 'mypass'
$file_name = @ComputerName & ".txt"

$Open = _FTPOpen('MyFTP Control')
$Conn = _FTPConnect($Open, $server, $username, $pass)
$Ftpp = _FtpPutFile($Conn, 'C:\test.txt', $file_name); my problem is here :S
$Ftpc = _FTPClose($Open)

[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Share this post


Link to post
Share on other sites

that work :think: .

Ty SpookMeister

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

ur probelm was u put the thing in quotes not

/@computername & '.txt'
Edited by thatsgreat2345

Share this post


Link to post
Share on other sites

I just have a second question :">

If i have the script in same folder that 'test.txt' ,

Can I do something for have :

, '\test.txt'
and not :
, 'C:\test.txt'
?

Thanx for help :think:

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

just typing \ automaticaly takes you to the C:\ drive so in ur case if the text file was in the C:\ drive its going to be opened there but if u moved it then no its not going to work

- to test just go write a \ in a folder

Edited by thatsgreat2345

Share this post


Link to post
Share on other sites

hmm so if u have the script & the "test.txt" in: c:\test\script\ I can't do anything for just have

, '\test.txt'
?

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

ok if you go to C:\

if u just type \test.txt then its going to work for you

BUT

if you have the file in c:\test\script\text.txt

and ur only using

\test.txt

its going to look in just

c:\test.txt

so there is a way and im pretty sure using @scriptdir

Edited by thatsgreat2345

Share this post


Link to post
Share on other sites

Ok thanks for your answers :think:

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