JBeardNC Posted August 3, 2009 Share Posted August 3, 2009 Hey everyone. We are implementing cwRsync in our environment and for those who are familiar with it, you know it is basically a command line utility that is run from a .bat or .cmd file. Below is the .bat file that I've written and it works perfectly to backup my files to a remote computer called BACKUP-PC. However, my management does not like how anyone could open the file in Notepad and view the password so I told them that I thought I could write it in AutoIt and then compile it into .exe format so that the password would not be in plain text for everyone to see. I'm trying to figure out the best way to do this. Using the example below, is it possible to make this into AutoIt? I've used @comspec before but what about the two SET commands at the top. How do I set those two variables since they are variables that are for the rsync executable, not variables for the script? For example, in AutoIt, if I put Run(@comspec & " /c " & "SET CYGWIN=nontsec") on one line and then Run(@comspec & " /c " & "SET RSYNC_PASSWORD=pa55w0rd") on the next line, doesnt that run those two lines separately and once they run, the variables are erased from memory? Maybe I'm wrong, I dont know much about the SET command. If anyone has any ideas, please let me know. Thanks! .BAT file looks like this... SET CYGWIN=nontsec SET RSYNC_PASSWORD=pa55w0rd cd "%ProgramFiles%/cwRsync/bin/" echo "Start Time is " %TIME% rsync --stats -vru --log-file=/cygdrive/c/rsync.log --chmod u+rwx --super /cygdrive/c/Files* %USERNAME%@BACKUP-PC::%USERNAME%/Files echo "Finish Time is " %TIME% pause Link to comment Share on other sites More sharing options...
exodius Posted August 4, 2009 Share Posted August 4, 2009 What you've pasted for your .bat file doesn't make a whole lot of sense... Using the SET command is basically declaring a variable for use in your .bat file, but you never use either of the variables you've declared...? Link to comment Share on other sites More sharing options...
Authenticity Posted August 4, 2009 Share Posted August 4, 2009 They are for the program not for the command shell. Look up EnvSet() function in the help file, the cd "%programfiles%\cwrsync\bin" can be replaced by the second parameter of Run/RunWait functions. Link to comment Share on other sites More sharing options...
JBeardNC Posted August 4, 2009 Author Share Posted August 4, 2009 They are for the program not for the command shell. Look up EnvSet() function in the help file, the cd "%programfiles%\cwrsync\bin" can be replaced by the second parameter of Run/RunWait functions.Thanks Authenticity! Thats exactly what I was looking for! Appreciate the help. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now