Variables in Batch FTP script -


in C you type % username% as the for the current user name for the directory listing and such as: c: \ documents and settings \% username%

Is there anything like this for batch script? Just do not help using the % username% .

I have written a script which accesses my FTP server so that I can load the file on the server. I want my friends to use this script, but I do not want to write many different scripts. Even I have so far:

  @echo off @ftp -s: "% ~ f0" and goto: EOF Open FTP.server.com User Pass CD / Home / FTP Bin  

If you change the batch file, then it can be done when you write the script file in the script file for each script file when the batch file is running. > Using echo command , which you can type in ftp Can send. The reason for this is that% code before expanding the echo script file will expand the username% variable:

  @echo off del script.txt echo open FTP server. Com & gt; & Gt; Script.txt [echo the rest of the script lines] Echo lcd "c: \ Documents and Settings \ Username% \ My Documents \ FTP"> gt; Script .txt echo echo mput * txt & gt; & Gt; Script.txt @ftp -s: script.txt  

Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -