Sign in to follow this  
Followers 0
Moreno

Problems with variables

4 posts in this topic

Hi, everybody! I´m from Brazil and I am really new using Autoit3. Actually, I began testing it today. I´m trying to make a tool to backup files from local computers to a server computer at my work, but of course I am doing something wrong. I need the user to type its LOGIN to populate a variable and send the variable to the command "Filecopy" in the path. Could anybody help me please?

Thanks

Moreno

heres my script:

--------------------------------------------------------------------------------------------------------------------

;Creating a variable

Dim $userlogin

;populate a variable with the userlogin

$login = InputBox("LOGIN", "Enter your login do backup your files to the server.", "", "")

;Copying local files to the server

FileCopy("D:\users\"$userlogin"\Desktop\*.*", "\\comput1-backup1\Backup1", 1)

FileCopy("D:\users\"$userlogin"\My documents\*.*", "\\comput1-backup1\Backup1", 1)

MsgBox(4096, "Check your files in the server (\\comput1-backup1\Backup1) with your credentials. Any question call...., 10)

Share this post


Link to post
Share on other sites

#2 ·  Posted (edited)

Welcome to Autoit :)

You dont need to dim $userlogin. This should be like this $userlogin = InputBox("LOGIN", "Enter your login do backup your files to the server.", "", "")

$userlogin = InputBox("LOGIN", "Enter your login do backup your files to the server.", "", "")
;Copying local files to the server
FileCopy("D:\users\" & $userlogin & "\Desktop\*.*", "\\comput1-backup1\Backup1", 1)
FileCopy("D:\users\" & $userlogin & "\My documents\*.*", "\\comput1-backup1\Backup1", 1)
MsgBox(4096,"", "Check your files in the server (\\comput1-backup1\Backup1) with your credentials. Any question call...., 10")
Edited by DjDeep00

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

[edit] eh, DjDeep00 beat me to it.

Edited by Brickoneer

Share this post


Link to post
Share on other sites

Ok, DjDeep00

thanks for your help. I will try it now.

Have a good day!

Moreno

--------------------------------------

Welcome to Autoit :)

You dont need to dim $userlogin. This should be like this $userlogin = InputBox("LOGIN", "Enter your login do backup your files to the server.", "", "")

$userlogin = InputBox("LOGIN", "Enter your login do backup your files to the server.", "", "")
;Copying local files to the server
FileCopy("D:\users\" & $userlogin & "\Desktop\*.*", "\\comput1-backup1\Backup1", 1)
FileCopy("D:\users\" & $userlogin & "\My documents\*.*", "\\comput1-backup1\Backup1", 1)
MsgBox(4096,"", "Check your files in the server (\\comput1-backup1\Backup1) with your credentials. Any question call...., 10")

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