Script Syntax

  • Thread starter Thread starter Paul Banco
  • Start date Start date
P

Paul Banco

All,

I am trying to map a particular drive through a login script. I am use this
syntax if "%username%"= = "xuser" net use \\server\share

For some reason I can not get this to work. Does anyone know the correct
syntax or have a place on the web that has some samples?

Thanks
Paul
 
Your syntax appears mostly accurate though you included a space between
the "==" function and neglected to specify a drive letter, either of
which may be the cause of your problem -

if "%username%"== "xuser" net use F: \\server\share

HTH

Dean
 
Dean,

I tried both of these scripts below and they did not work. She can manually
map to the drive. Does it matter that she is not mapping to the share level
but one deep.

if "%username%"== "Jlundgren" net use N: \\ob12\finance$\scanning
if %username% == Jlundgren net use N: \\ob12\finance$\scanning
Dean Wells said:
Your syntax appears mostly accurate though you included a space between
the "==" function and neglected to specify a drive letter, either of
which may be the cause of your problem -

if "%username%"== "xuser" net use F: \\server\share

HTH

Dean

--
Dean Wells [MVP / Windows platform]
MSEtechnology
[[ Please respond to the Newsgroup only regarding posts ]]
R e m o v e t h e m a s k t o s e n d e m a i l


Paul Banco said:
All,

I am trying to map a particular drive through a login script. I am use this
syntax if "%username%"= = "xuser" net use \\server\share

For some reason I can not get this to work. Does anyone know the correct
syntax or have a place on the web that has some samples?

Thanks
Paul
 
That depends on the client type ... what OS is the script executing on?

In addition, have you determined if the case of your string comparison
is the cause. Try this as well -

if /i "%username%"== "xuser" net use F: \\server\share

If this continues to fail, redirect stderr to a file by appending -

2>error.log

.... to the end of the net use command.

Dean

--
Dean Wells [MVP / Windows platform]
MSEtechnology
[[ Please respond to the Newsgroup only regarding posts ]]
R e m o v e t h e m a s k t o s e n d e m a i l


Paul Banco said:
Dean,

I tried both of these scripts below and they did not work. She can manually
map to the drive. Does it matter that she is not mapping to the share level
but one deep.

if "%username%"== "Jlundgren" net use N: \\ob12\finance$\scanning
if %username% == Jlundgren net use N: \\ob12\finance$\scanning
Dean Wells said:
Your syntax appears mostly accurate though you included a space between
the "==" function and neglected to specify a drive letter, either of
which may be the cause of your problem -

if "%username%"== "xuser" net use F: \\server\share

HTH

Dean

--
Dean Wells [MVP / Windows platform]
MSEtechnology
[[ Please respond to the Newsgroup only regarding posts ]]
R e m o v e t h e m a s k t o s e n d e m a i l


Paul Banco said:
All,

I am trying to map a particular drive through a login script. I am
use
this
syntax if "%username%"= = "xuser" net use \\server\share

For some reason I can not get this to work. Does anyone know the correct
syntax or have a place on the web that has some samples?

Thanks
Paul
 
Dean,

That worked. What exactly does the if /i do? Also I posted a LPT problem
under Paul Banco. I know you are busy but if you can take a look at that as
well it would be greatly appreciated.

Thanks for all your help
Paul
Dean Wells said:
That depends on the client type ... what OS is the script executing on?

In addition, have you determined if the case of your string comparison
is the cause. Try this as well -

if /i "%username%"== "xuser" net use F: \\server\share

If this continues to fail, redirect stderr to a file by appending -

2>error.log

... to the end of the net use command.

Dean

--
Dean Wells [MVP / Windows platform]
MSEtechnology
[[ Please respond to the Newsgroup only regarding posts ]]
R e m o v e t h e m a s k t o s e n d e m a i l


Paul Banco said:
Dean,

I tried both of these scripts below and they did not work. She can manually
map to the drive. Does it matter that she is not mapping to the share level
but one deep.

if "%username%"== "Jlundgren" net use N: \\ob12\finance$\scanning
if %username% == Jlundgren net use N: \\ob12\finance$\scanning
Dean Wells said:
Your syntax appears mostly accurate though you included a space between
the "==" function and neglected to specify a drive letter, either of
which may be the cause of your problem -

if "%username%"== "xuser" net use F: \\server\share

HTH

Dean

--
Dean Wells [MVP / Windows platform]
MSEtechnology
[[ Please respond to the Newsgroup only regarding posts ]]
R e m o v e t h e m a s k t o s e n d e m a i l


All,

I am trying to map a particular drive through a login script. I am use
this
syntax if "%username%"= = "xuser" net use \\server\share

For some reason I can not get this to work. Does anyone know the
correct
syntax or have a place on the web that has some samples?

Thanks
Paul
 
Back
Top