<<Please correct me if I have posted this in the wrong place>>
The following is part of a GPO Login script that to creates a
new DSN connection for a SQL database, it goes to PCs in
a WAN, that are either XP Pro SP2 or Win2000 SP?.
It seems to error out on the 5th line, for some users, but when the
HelpDesk remotes in with admin account they can run the VBS fle
from explore and it works fine. The error says something about the
driver location, which I have checked on some Failed PCs, and it's there,
but hidden.
Can someone tell me a better way to write that line, or the whole
process??
and what might be the cause of an error like this, that only happens for
some users,
and then works for admin..
ALSO how can I create an IF THEN so that this wont attempt to run on PCs
where the DSN already exists???
THANK YOU !!!

Dim oWshShell
Const cRegKey1 = "HKLM\Software\ODBC\ODBC.INI\NewSQL\"
Const cRegKey2 = "HKLM\Software\ODBC\ODBC.INI\ODBC Data Sources\"
Set oWshShell = CreateObject ("WScript.Shell")
oWshShell.RegWrite cRegKey1 &
"Driver","C:\%systemroot%\System32\sqlsrv32.dll"

Re: Login Scripting by billy

billy
Wed Oct 18 21:07:55 CDT 2006


WANNABE wrote:
> <<Please correct me if I have posted this in the wrong place>>
> The following is part of a GPO Login script that to creates a
> new DSN connection for a SQL database, it goes to PCs in
> a WAN, that are either XP Pro SP2 or Win2000 SP?.
> It seems to error out on the 5th line, for some users, but when the
> HelpDesk remotes in with admin account they can run the VBS fle
> from explore and it works fine. The error says something about the
> driver location, which I have checked on some Failed PCs, and it's there,
> but hidden.
> Can someone tell me a better way to write that line, or the whole
> process??
> and what might be the cause of an error like this, that only happens for
> some users,
> and then works for admin..
> ALSO how can I create an IF THEN so that this wont attempt to run on PCs
> where the DSN already exists???
> THANK YOU !!!
>
> Dim oWshShell
> Const cRegKey1 = "HKLM\Software\ODBC\ODBC.INI\NewSQL\"
> Const cRegKey2 = "HKLM\Software\ODBC\ODBC.INI\ODBC Data Sources\"
> Set oWshShell = CreateObject ("WScript.Shell")
> oWshShell.RegWrite cRegKey1 &
> "Driver","C:\%systemroot%\System32\sqlsrv32.dll"

Logon scripts run under the user's credentials.
standard User accounts can not write to HKLM.
startup and shutdown scripts run as System, so set your script as one
of these.


Re: Login Scripting by WANNABE

WANNABE
Fri Oct 20 09:53:29 CDT 2006

It's set to run as startup script in GPO and the error is seems to be RIGHTS
related... that is what I find so puzzling about this problem...
=================================================
"billy" <wcasse@yahoo.com> wrote in message
news:1161223675.564181.68400@m7g2000cwm.googlegroups.com...
>
> WANNABE wrote:
>> <<Please correct me if I have posted this in the wrong place>>
>> The following is part of a GPO Login script that to creates a
>> new DSN connection for a SQL database, it goes to PCs in
>> a WAN, that are either XP Pro SP2 or Win2000 SP?.
>> It seems to error out on the 5th line, for some users, but when the
>> HelpDesk remotes in with admin account they can run the VBS fle
>> from explore and it works fine. The error says something about the
>> driver location, which I have checked on some Failed PCs, and it's there,
>> but hidden.
>> Can someone tell me a better way to write that line, or the whole
>> process??
>> and what might be the cause of an error like this, that only happens for
>> some users,
>> and then works for admin..
>> ALSO how can I create an IF THEN so that this wont attempt to run on
>> PCs
>> where the DSN already exists???
>> THANK YOU !!!
>>
>> Dim oWshShell
>> Const cRegKey1 = "HKLM\Software\ODBC\ODBC.INI\NewSQL\"
>> Const cRegKey2 = "HKLM\Software\ODBC\ODBC.INI\ODBC Data Sources\"
>> Set oWshShell = CreateObject ("WScript.Shell")
>> oWshShell.RegWrite cRegKey1 &
>> "Driver","C:\%systemroot%\System32\sqlsrv32.dll"
>
> Logon scripts run under the user's credentials.
> standard User accounts can not write to HKLM.
> startup and shutdown scripts run as System, so set your script as one
> of these.
>