regis Posted August 21, 2006 Posted August 21, 2006 Hello everybody, I want to make a script who made this but in autoit: Net use X: \\server\share\%username% I made this DriveMapAdd ("x:, "\\server\share\'@username") But the @username variable have not been reconized. How can i do for return the username into the path directory? Sorry for my bad english. Thank's
Danny35d Posted August 21, 2006 Posted August 21, 2006 (edited) Welcome to AutoIt...You have @username between quotes.Try this ==> DriveMapAdd ("x:", "\\server\share\" & @username) Edited August 21, 2006 by Danny35d AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line
regis Posted August 21, 2006 Author Posted August 21, 2006 Welcome to AutoIt...You have @username between quotes.Try this ==> DriveMapAdd ("x:", "\\server\share\" & @username)Fast and correct thank you very muchi was trying DriveMapAdd ("x:", "\\server\share\ & @username")but it didn't work anymore just for a bad quote...
regis Posted August 22, 2006 Author Posted August 22, 2006 In the same way i try to execute a home made program which, in my batch work's like that:c:\make.exe %username% "x:"The program function is to make username directory (and inside link's with sql) into the x: mapped network.So in autoit i try this DriveMapDel("x:")DriveMapAdd("x:", "\\server\share")Run('c:\make.exe' & ' "%username%" "x:" ')DriveMapDel("x:")DriveMapAdd("x:", "\\server\share\" & @username)it seems that the line in bold is not working.i've seen the syntax in an other post so it seem good for me...But not for autoit Thanks for your help.
Xenobiologist Posted August 22, 2006 Posted August 22, 2006 HI, %username% should it be the loggedon username or a parameter given to the called script? So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times
buzz44 Posted August 22, 2006 Posted August 22, 2006 (edited) DriveMapDel("X:") DriveMapAdd("X:", "\\server\share") Run("C:\Make.exe " & @UserName & ' "X:"') DriveMapDel("X:") DriveMapAdd(":", "\\server\share\" & @UserName) Edited August 22, 2006 by Burrup qq
regis Posted August 22, 2006 Author Posted August 22, 2006 Well it should be the loggedon username. But i use it with the application that why i put the windows variable %username%. I tried with @username but i got an error message.
buzz44 Posted August 22, 2006 Posted August 22, 2006 (edited) What error message? Edited August 23, 2006 by Larry qq
regis Posted August 22, 2006 Author Posted August 22, 2006 Ok i was puting Run('c:\make.exe' & @username & ' "X:"') instead Run("C:\Make.exe " & @UserName & ' "X:"') quote, quote always the quote simple quote seem to be for variable to use outside the autoit code and double quote inside th code. Is that it ? Thank whatever.
buzz44 Posted August 22, 2006 Posted August 22, 2006 (edited) Just copy/paste the code I provided @@. Edited August 23, 2006 by Larry qq
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