Jump to content

windows username for file name (help)


 Share

Recommended Posts

I'm trying to create a script that will download users databases that are named example: something_username.dbs

I only want to download the file for that user when they run the script.

downloading antrenamer just as a test below to see if I could save file with the users name in it.

What am I missing?

$User = @UserName

Local $hDownload = InetGet("http://update.antp.be/renamer/antrenamer2_install.exe", @HomeDrive & "\$User_antrenamer2_install.exe", 1, 1)
Do
    Sleep(250)
Until InetGetInfo($hDownload, 2)    ; Check if the download is complete.
Local $nBytes = InetGetInfo($hDownload, 0)
InetClose($hDownload)   ; Close the handle to release resourcs.
MsgBox(0, "", "Bytes read: " & $nBytes)
Link to comment
Share on other sites

get $user out of the quotes

@HomeDrive & "\" & $User & "_antrenamer2_install.exe"
Edited by iamtheky

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...