Followers 0

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

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)

that work .

Ty SpookMeister

##### Share on other sites

#4 ·  Posted (edited)

ur probelm was u put the thing in quotes not

/@computername & '.txt'
Edited by thatsgreat2345

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

##### 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 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 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 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'
?
@scriptdir & '\test.txt'

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