Jump to content

Variable return to a path directory


regis
 Share

Recommended Posts

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

Link to comment
Share on other sites

Welcome to AutoIt...

You have @username between quotes.

Try this ==> DriveMapAdd ("x:", "\\server\share\" & @username)

Fast and correct thank you very much

i was trying DriveMapAdd ("x:", "\\server\share\ & @username")

but it didn't work anymore just for a bad quote...

Link to comment
Share on other sites

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 :P

Thanks for your help.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

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...