Hello,

I'm hoping someone can help me with this.

We have change all our login scripts to vbscripts instead of batch files.
All works great except on two machines.

They get an error saying cannot find netlogon because the script has
strDomainServer =%logonserver%\netlogon on one of the lines. The thing is, I
can do a Start-Run %logonserver%\netlogon and it opens the folder on the
domain controller just fine. I changed the script to strDomainServer
=\\"mydomain.com", but that won't work either, but I think it might be
getting hungup on a different variable now.

For whatever reason, it doesn't appear that the machine can pass the
variable info on (ie. computer name, user name).

Does anyone have any suggestions? I could reformat the machines, but would
rather fix the problem.

Thanks!

Re: Variable not being passed by Babu

Babu
Wed Aug 09 10:40:26 CDT 2006

sounds like 2 machines dont have that variable set in the environment.
what if you ECHO %logonserver% on one of the failing machines?


"Dawn" <Dawn@discussions.microsoft.com> wrote in message
news:12308906-CF08-454C-A183-2BB96DF02E69@microsoft.com...
> Hello,
>
> I'm hoping someone can help me with this.
>
> We have change all our login scripts to vbscripts instead of batch files.
> All works great except on two machines.
>
> They get an error saying cannot find netlogon because the script has
> strDomainServer =%logonserver%\netlogon on one of the lines. The thing
> is, I
> can do a Start-Run %logonserver%\netlogon and it opens the folder on the
> domain controller just fine. I changed the script to strDomainServer
> =\\"mydomain.com", but that won't work either, but I think it might be
> getting hungup on a different variable now.
>
> For whatever reason, it doesn't appear that the machine can pass the
> variable info on (ie. computer name, user name).
>
> Does anyone have any suggestions? I could reformat the machines, but
> would
> rather fix the problem.
>
> Thanks!



Re: Variable not being passed by Dawn

Dawn
Wed Aug 09 13:10:02 CDT 2006

Hi,

Thanks for responding. When I do ECHO %logonserver% it does kick back the
correct domain controller. That's why this is so confusing. The other thing
I forgot to mention is that when a user runs this login script, it creates a
log file that we can look at in case of a problem. Niether one of these
machines creates this log file because it never gets through the rest of the
script.

Thanks!

"Babu VT" wrote:

> sounds like 2 machines dont have that variable set in the environment.
> what if you ECHO %logonserver% on one of the failing machines?
>
>
> "Dawn" <Dawn@discussions.microsoft.com> wrote in message
> news:12308906-CF08-454C-A183-2BB96DF02E69@microsoft.com...
> > Hello,
> >
> > I'm hoping someone can help me with this.
> >
> > We have change all our login scripts to vbscripts instead of batch files.
> > All works great except on two machines.
> >
> > They get an error saying cannot find netlogon because the script has
> > strDomainServer =%logonserver%\netlogon on one of the lines. The thing
> > is, I
> > can do a Start-Run %logonserver%\netlogon and it opens the folder on the
> > domain controller just fine. I changed the script to strDomainServer
> > =\\"mydomain.com", but that won't work either, but I think it might be
> > getting hungup on a different variable now.
> >
> > For whatever reason, it doesn't appear that the machine can pass the
> > variable info on (ie. computer name, user name).
> >
> > Does anyone have any suggestions? I could reformat the machines, but
> > would
> > rather fix the problem.
> >
> > Thanks!
>
>
>

Re: Variable not being passed by DontBotherReplying

DontBotherReplying
Wed Aug 09 14:13:59 CDT 2006

The %logonserver% is an environmental variable. VBScript does not
automatically translate unless it is told to.

Here is how you tell VBScript to translate these variables:
set shell = WScript.CreateObject( "WScript.Shell" )
strDomainServer = shell.ExpandEnvironmentStrings("%LogonServer%") &
"\netlogon"


Re: Variable not being passed by Dawn

Dawn
Wed Aug 09 14:53:13 CDT 2006

Hi,

Yes, the script contains:

Set objShell = WScript.CreateObject("WScript.Shell")
strDomainServer = objShell.ExpandEnvironmentStrings("%LOGONSERVER%")

The script runs create on 180 machines except these 2. These 2 are able to
run other vbscripts (at first we thought it was something blocking vb), just
not ones that contain any variable.

Thanks!

"DontBotherReplying" wrote:

> The %logonserver% is an environmental variable. VBScript does not
> automatically translate unless it is told to.
>
> Here is how you tell VBScript to translate these variables:
> set shell = WScript.CreateObject( "WScript.Shell" )
> strDomainServer = shell.ExpandEnvironmentStrings("%LogonServer%") &
> "\netlogon"
>
>

RE: Variable not being passed by Dawn

Dawn
Wed Aug 09 17:16:58 CDT 2006

Thanks for your help, but I fixed it.

I installed Windows Script 5.6 and the script worked fine after that. Must
have been a corrupt dll.

"Dawn" wrote:

> Hello,
>
> I'm hoping someone can help me with this.
>
> We have change all our login scripts to vbscripts instead of batch files.
> All works great except on two machines.
>
> They get an error saying cannot find netlogon because the script has
> strDomainServer =%logonserver%\netlogon on one of the lines. The thing is, I
> can do a Start-Run %logonserver%\netlogon and it opens the folder on the
> domain controller just fine. I changed the script to strDomainServer
> =\\"mydomain.com", but that won't work either, but I think it might be
> getting hungup on a different variable now.
>
> For whatever reason, it doesn't appear that the machine can pass the
> variable info on (ie. computer name, user name).
>
> Does anyone have any suggestions? I could reformat the machines, but would
> rather fix the problem.
>
> Thanks!