WSH script to remove system and user DSN

‘Gregor Stefka

Const HKEY_LOCAL_MACHINE = &H80000002
Const HKEY_CURRENT_USER  = &H80000001

strComputer  = “.”
strDSN  = “YourDSN”

Set objReg=GetObject(“winmgmts:{impersonationLevel=impersonate}!\\” & _
    strComputer & “\root\default:StdRegProv”)
 
strKeyPath = “SOFTWARE\ODBC\ODBC.INI\” & strDSN
objReg.DeleteKey HKEY_LOCAL_MACHINE, strKeyPath
objReg.DeleteKey HKEY_CURRENT_USER, strKeyPath

strKeyPath = “SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources”
objReg.DeleteValue HKEY_LOCAL_MACHINE,strKeyPath,strDSN
objReg.DeleteValue HKEY_CURRENT_USER ,strKeyPath,strDSN

Leave a Comment

WSH Script to add or replace system path variable

strNewPath  =”d:\newpath;”
strPathToReplace =”f:\pathToReplace;”

‘********************************* SET YOUR PATH ABOVE************************
‘Gregor Stefka
Const HKEY_LOCAL_MACHINE  = &H80000002
strComputer    = “.”
strKeyPath    = “SYSTEM\CurrentControlSet\Control\Session Manager\Environment”
strValueName    = “Path”

Set oReg=GetObject(“winmgmts:{impersonationLevel=impersonate}!\\” & strComputer & “\root\default:StdRegProv”)
oReg.GetExpandedStringValue HKEY_LOCAL_MACHINE,strKeyPath, strValueName,strValue
bAllreadySet    = InStr(1, strValue, strNewPath, 1)

‘Wscript.Echo  “The OldPath is: ” & strValue

‘Only add if its not set:
If bAllreadySet = 0 then
 If strPathToReplace =”” or InStr(1, strValue,strPathToReplace, 1) = 0 then
  strNewPath = strNewPath & strValue
 Else
  strNewPath = Replace(strValue, strPathToReplace, strNewPath)
 End If

 ‘ write the path
 oReg.SetExpandedStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strNewPath
 ‘Wscript.Echo  “The New Path is: ” & strNewPath

End If

Leave a Comment

My new guitar: Gibson Les Paul Studio Faded (Limited WCCR)

Tags: , ,

Leave a Comment

Cool Photo Tool: Photosynth

Ever  tried to do panorama pictures with your digicam? Its not that easy to use, and hard to do real big panoramas. A tool that makes the shooting and generating of  complete 3D Views easy: Photosynth. Photosynth builds a 3D Point cloud of a photographed object. Take a look at http://photosynth.net/ . An explanation of how to use PhotoSynth can be found at http://blip.tv/file/1190926/. Take a look. Its a really cool technology.

Leave a Comment

my wish list for the living room

a digital picture frame with the following features:

  1. WiFi 802.11b/g/n  Support
  2. Any UNC/FTP path as a picture source. Maybe online (flickr or Picasa WebAlbum support)
  3. google / outlook Calendar support
  4. RSS feeds support.
  5. a remote control
  6. a timer (show calendar / RSS news 6:00 – 8:00 show pics from 15:00 – 22:00)

a “Media Player Device” to stream digital content to my TV and my Stereo.

  1. HD(MI) support
  2. WiFi 802.11b/g/n  Support
  3. Playback of almost any source (online like Zattoo, YouTube UNC and CD/DVD source)
  4. DRM Support to playback protected stuff like iTunes and others.
  5. recording capabilities. Timeshift support  for TV. Copy Video and Audio.

Leave a Comment

Intel S5000PSL shows only 2.5GB in Windows 2003 x86

The only way i know of is to enable PAE in the boot.ini (/PAE)

See http://downloadmirror.intel.com/12820/ENG/SL_74release.txt

and http://support.intel.com/support/motherboards/server/s5000psl/sb/CS-022924.htm.

After reboot you’ll see the hole 4GB in Windows.

Leave a Comment

The Days After…

last weekend i had my first two Gigs with my Band Find Your Mind. Frist one at a private halloween party on Friday the 27th and the other as the opener at the “Duisburger Rocknacht” Oct, 28th! This was my first time for many many maaaaany years on stage 🙂 ! Hurray.

Comments (1)

become a rockstar ;)

i ve joined up an existing band a few weeks ago. One of their songs (or should i say our song?, no not yet) is listed on the mp3 charts :-):

http://mp3.de/promo/charts/070000
lookout for a band named "Find Your Mind" :)
mp3.de/home/find_your_mind  

Comments (1)

Microsoft ISA Server 2004: Using SQL based Logging

ISA Server 2004 Supports 3 Types of Logging. File based, Integrated MSDE or ODBC/SQL Server. The downsite of the Filebased and MSDE based solution is its limited capacity, the additional load to the ISA Server and the possible security risk. (You should store the logs of your ISA on a different and additionally secured machine…)

So, i decided to use the ODBC / SQL Server based logging. But how to set it up? ISA Server does create its logging tables in the target ODBC or SQL Server. And i cant find any SQL Scripts for easy table creation. Not even on g00gle. :-/

I ve tried to copy the table Layout from the internal ISA MSDE instance, but the table layout is not the same. ISA uses a different table schema. One for the MSDE one for ODBC / SQL Server based logging. (btw: the internal MSDE instance is named msfw. Connect with Windows Auth as Admin to “(local)\msfw” on the ISA Box.)

The only way i saw, was to do a little bit of SQL Server auditing to catch the hole communication between ISA and SQL Server. To do this, i ve used the MS SQL Profiler to log every SQL statement ISA server sends to the SQL server. Based on the results i ve build up two tables which can handle the isa server logs:

CREATE TABLE [FW] (
[servername] [nvarchar] (128) COLLATE Latin1_General_CI_AS NULL ,
[logTime] [datetime] NULL ,
[logDate] [smalldatetime] null, –Added by GS / 27.08.2006
[protocol] [varchar] (32) COLLATE Latin1_General_CI_AS NULL ,
[Source] varchar(200) NULL , — Added by GS / 27.08.2006
[SourceIP] [bigint] NULL ,
[SourcePort] [int] NULL ,
[DESTINATION] varchar(200) NULL , — Added by GS / 27.08.2006
[DestinationIP] [bigint] NULL ,
[DestinationPort] [int] NULL ,
[OriginalClientIP] varchar(32) null, –changed from BIGINT to varchar by GS / 27.08.2006
[SourceNetwork] [nvarchar] (128) COLLATE Latin1_General_CI_AS NULL ,
[DestinationNetwork] [nvarchar] (128) COLLATE Latin1_General_CI_AS NULL ,
[Action] varchar(100) NULL , — Changed by GS. was smallint, now: varchar! / 27.08.2006
[resultcode] [int] NULL ,
[rule] [nvarchar] (128) COLLATE Latin1_General_CI_AS NULL ,
[ApplicationProtocol] [nvarchar] (128) COLLATE Latin1_General_CI_AS NULL ,
[Bidirectional] varchar(100) NULL , –Changed by GS. was smallint, now varchar / 27.08.2006
[bytessent] [bigint] NULL ,
[bytessentDelta] [bigint] NULL ,
[bytesrecvd] [bigint] NULL ,
[bytesrecvdDelta] [bigint] NULL ,
[connectiontime] [int] NULL ,
[connectiontimeDelta] [int] NULL ,
[SourceProxy] [varchar] (32) COLLATE Latin1_General_CI_AS NULL ,
[DestinationProxy] [varchar] (32) COLLATE Latin1_General_CI_AS NULL ,
[SourceName] [varchar] (255) COLLATE Latin1_General_CI_AS NULL ,
[DestinationName] [varchar] (255) COLLATE Latin1_General_CI_AS NULL ,
[ClientUserName] [varchar] (514) COLLATE Latin1_General_CI_AS NULL ,
[ClientAgent] [varchar] (255) COLLATE Latin1_General_CI_AS NULL ,
[sessionid] [int] NULL ,
[connectionid] [int] NULL ,
[Interface] [varchar] (25) COLLATE Latin1_General_CI_AS NULL ,
[IPHeader] [varchar] (255) COLLATE Latin1_General_CI_AS NULL ,
[Payload] [varchar] (255) COLLATE Latin1_General_CI_AS NULL
) ON [PRIMARY]
GO

CREATE TABLE [Web] (
[ClientIP] [bigint] NULL ,
[ClientUserName] [nvarchar] (514) COLLATE Latin1_General_CI_AS NULL ,
[ClientAgent] [varchar] (128) COLLATE Latin1_General_CI_AS NULL ,
[ClientAuthenticate] [smallint] NULL ,
[logTime] [datetime] NULL ,
[service] [smallint] NULL ,
[servername] [nvarchar] (32) COLLATE Latin1_General_CI_AS NULL ,
[referredserver] [varchar] (32) COLLATE Latin1_General_CI_AS NULL ,
[DestHost] [varchar] (255) COLLATE Latin1_General_CI_AS NULL ,
[DestHostIP] [bigint] NULL ,
[DestHostPort] [int] NULL ,
[processingtime] [int] NULL ,
[bytesrecvd] [bigint] NULL ,
[bytessent] [bigint] NULL ,
[protocol] [varchar] (12) COLLATE Latin1_General_CI_AS NULL ,
[transport] [varchar] (8) COLLATE Latin1_General_CI_AS NULL ,
[operation] [varchar] (24) COLLATE Latin1_General_CI_AS NULL ,
[uri] [varchar] (2048) COLLATE Latin1_General_CI_AS NULL ,
[mimetype] [varchar] (32) COLLATE Latin1_General_CI_AS NULL ,
[objectsource] [smallint] NULL ,
[resultcode] [int] NULL ,
[CacheInfo] [int] NULL ,
[rule] [nvarchar] (128) COLLATE Latin1_General_CI_AS NULL ,
[FilterInfo] [nvarchar] (128) COLLATE Latin1_General_CI_AS NULL ,
[SrcNetwork] [nvarchar] (128) COLLATE Latin1_General_CI_AS NULL ,
[DstNetwork] [nvarchar] (128) COLLATE Latin1_General_CI_AS NULL ,
[ErrorInfo] [int] NULL ,
[Action] [smallint] NULL
) ON [PRIMARY]
GO

CREATE TABLE [Web] (
[ClientIP] varchar(32) NULL , –was BIGINT
[ClientUserName] [nvarchar] (514) COLLATE Latin1_General_CI_AS NULL ,
[ClientAgent] [varchar] (128) COLLATE Latin1_General_CI_AS NULL ,
[ClientAuthenticate] varchar(100) NULL , –was smallint
[logTime] [datetime] NULL ,
[logDate] [smalldatetime] null, –Added by GS / 27.08.2006
[service] varchar(100) NULL , — changed from smallint to vharchar GS/27.08.2006
[servername] [nvarchar] (32) COLLATE Latin1_General_CI_AS NULL ,
[referredserver] [varchar] (32) COLLATE Latin1_General_CI_AS NULL ,
[DestHost] [varchar] (255) COLLATE Latin1_General_CI_AS NULL ,
[DestHostIP] varchar(32) NULL , — was BIGINT
[DestHostPort] [int] NULL ,
[processingtime] [int] NULL ,
[bytesrecvd] [bigint] NULL ,
[bytessent] [bigint] NULL ,
[protocol] [varchar] (12) COLLATE Latin1_General_CI_AS NULL ,
[transport] [varchar] (8) COLLATE Latin1_General_CI_AS NULL ,
[operation] [varchar] (24) COLLATE Latin1_General_CI_AS NULL ,
[uri] [varchar] (2048) COLLATE Latin1_General_CI_AS NULL ,
[mimetype] [varchar] (32) COLLATE Latin1_General_CI_AS NULL ,
[objectsource] varchar(100) NULL , –was SMALLINT
[resultcode] [int] NULL ,
[CacheInfo] [int] NULL ,
[rule] [nvarchar] (128) COLLATE Latin1_General_CI_AS NULL ,
[FilterInfo] [nvarchar] (128) COLLATE Latin1_General_CI_AS NULL ,
[SrcNetwork] [nvarchar] (128) COLLATE Latin1_General_CI_AS NULL ,
[DstNetwork] [nvarchar] (128) COLLATE Latin1_General_CI_AS NULL ,
[ErrorInfo] [int] NULL ,
[Action] varchar(100) NULL — changed from smallint to varchar by GS / 27.06.2006
) ON [PRIMARY]
GO

Comments (4)

Forum shutdown at stefka.de

the good old Kyro II Forum at www.stefka.de is still online, but the main page of stefka.de redirects you immediately to this site. As an archive you can still access the forum here .

Leave a Comment