#190448 - 2008-10-31 05:25 PM
Re: Calling a .bat/.exe during logon
[Re: markdavies1978]
|
Gargoyle
MM club member
Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
|
Try adding this to your KiX script and test it.
$WinIni = %windir%+"\win.ini"
$ODBCIni = %windir%+"\odbc.ini"
$RC = WriteProfileString($WinIni,"db9server","Driver","C:\WINNT\SYSTEM\sqlsrvr.dll")
$RC = WriteProfileString($WinIni,"db9server","Description","")
$RC = WriteProfileString($WinIni,"db9server","Server","db9server")
$RC = WriteProfileString($WinIni,"db9server","Address","172.27.44.54,1443")
$RC = WriteProfileString($WinIni,"db9server","UseProcForPrepare","Yes")
$RC = WriteProfileString($WinIni,"db9server","QuotedId","Yes")
$RC = WriteProfileString($WinIni,"db9server","AnsiNPW","Yes")
$RC = WriteProfileString($WinIni,"db9server","OemtoAnsi","No")
$RC = WriteProfileString($WinIni,"db9server","Trusted_Connection","")
$RC = WriteProfileString($ODBCIni,"ODBC Data Sources","db9server","SQL Server")
_________________________
Today is the tomorrow you worried about yesterday.
|
Top
|
|
|
|
#190450 - 2008-10-31 06:11 PM
Re: Calling a .bat/.exe during logon
[Re: BradV]
|
markdavies1978
Fresh Scripter
Registered: 2008-10-30
Posts: 17
|
What is the content of test.bat?
cscript odbc_ini.vbs
|
Top
|
|
|
|
#190451 - 2008-10-31 06:12 PM
Re: Calling a .bat/.exe during logon
[Re: Gargoyle]
|
markdavies1978
Fresh Scripter
Registered: 2008-10-30
Posts: 17
|
Try adding this to your KiX script and test it.
$WinIni = %windir%+"\win.ini"
$ODBCIni = %windir%+"\odbc.ini"
$RC = WriteProfileString($WinIni,"db9server","Driver","C:\WINNT\SYSTEM\sqlsrvr.dll")
$RC = WriteProfileString($WinIni,"db9server","Description","")
$RC = WriteProfileString($WinIni,"db9server","Server","db9server")
$RC = WriteProfileString($WinIni,"db9server","Address","172.27.44.54,1443")
$RC = WriteProfileString($WinIni,"db9server","UseProcForPrepare","Yes")
$RC = WriteProfileString($WinIni,"db9server","QuotedId","Yes")
$RC = WriteProfileString($WinIni,"db9server","AnsiNPW","Yes")
$RC = WriteProfileString($WinIni,"db9server","OemtoAnsi","No")
$RC = WriteProfileString($WinIni,"db9server","Trusted_Connection","")
$RC = WriteProfileString($ODBCIni,"ODBC Data Sources","db9server","SQL Server")
How can I run this for specific users only?
Edited by markdavies1978 (2008-10-31 06:12 PM)
|
Top
|
|
|
|
#190453 - 2008-10-31 07:34 PM
Re: Calling a .bat/.exe during logon
[Re: Gargoyle]
|
markdavies1978
Fresh Scripter
Registered: 2008-10-30
Posts: 17
|
Thanks Gargoyle, getting there!
It has now addedd the required ODBC entry apart from the IP address!
|
Top
|
|
|
|
#190460 - 2008-11-01 12:11 PM
Re: Calling a .bat/.exe during logon
[Re: Gargoyle]
|
markdavies1978
Fresh Scripter
Registered: 2008-10-30
Posts: 17
|
I'm still stuggling to get the IP address added to the ODBC setting.
It adds the SQL entry & server name fine which is great just not the Network Address...
I think the code from the previous posts isn't adding the address to C:\Windows\win.ini & C:\Windows\ODBC.ini
|
Top
|
|
|
|
#190475 - 2008-11-03 08:28 PM
Re: Calling a .bat/.exe during logon
[Re: Gargoyle]
|
markdavies1978
Fresh Scripter
Registered: 2008-10-30
Posts: 17
|
Gargoyle,
Having had a chat with 1 of my developers I simply had to adjust the example code you posted.
Thanks.
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 259 anonymous users online.
|
|
|