Sign in to follow this  
Followers 0
bertotto

@computername

3 posts in this topic

HELLO

IS IT POSSIBLE TO GET @COMPUTERNAME VALUE IN THE NAME OF A FILE using _FileCreate?

example :

if the @computername value is 5p0105, create a file c:\windows\5p0105.txt

regards

thanks for your help and advises

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

HELLO

IS IT POSSIBLE TO GET @COMPUTERNAME VALUE IN THE NAME OF A FILE using _FileCreate?

example :

if the @computername value is 5p0105, create a file c:\windows\5p0105.txt

regards

thanks for your help and advises

$FOpen = FileOpen(@WindowsDir & '\' & @ComputerName & '.txt', 10)
FileClose($FOpen)

Edit:

After looking at mine, I had 8 to create the directory, but you need 1 or 2 as Jdeb shows below to write (to create it).

Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

HELLO

IS IT POSSIBLE TO GET @COMPUTERNAME VALUE IN THE NAME OF A FILE using _FileCreate?

example :

if the @computername value is 5p0105, create a file c:\windows\5p0105.txt

regards

thanks for your help and advises

Yes.... did you try it ?

FileWriteLine(@Computername & ".txt", " text.......")

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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