Seiko Smart Label Printer Fix

By | October 25, 2006

Where I work we sell a lot of Seiko Smart Label Printers to customers.
We have recently found out that the new version (6.0.7) of the software breaks the label printers functionality.
We have contacted Seiko and their answer is to go to Add/Remove Programs and uninstall the software.
Great, but one problem! If you try to install an older version of the software the printer functionality is still broken.
So, with a little digging I discovered that the Seiko uninstaller leaves "junk" all over your computer.
My script will remove the "junk" and allow you to install an older version of the Seiko driver that works.

———-COPY EVERYTHING BELOW THIS LINE———-

'Script to remove Seiko Smart Label Printer Software 6.0.7
'The 6.0.7 version may break functionality of the label printer.
'Created by Cheyenne Harden October 25 2006
'Uninstall SLP
On Error Resume Next

Const HKCU = &H80000001
Const HKLM = &H80000002

Dim objWMIService, objProcess, objItem, objService, objArgs, objArgs1
Dim strComputer, strProcessKill, strService, strService2
Dim colListOfServices, colProcess, intSleep
Dim strHive, arrPath, strNewReg, strChar

strComputer = "."
strProcessKill = "'slpcap.exe'"
strComputer = "."
strService2 = "SLPMONX"
strService = "'" & strService2 & "'"
strChar = ""
intSleep = 5000

Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colComputer = objWMIService.ExecQuery _
("Select * from Win32_ComputerSystem")
For Each objComputer in colComputer
Result = Split(objComputer.UserName, "\")
'Wscript.Echo Result(1)
Next

Set colListOfServices = objWMIService.ExecQuery _
("Select * from Win32_Service Where Name ="_
& strService & " ")
For Each objService in colListOfServices
objService.StopService()
WSCript.Sleep intSleep
Next

Set colProcess = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = " & strProcessKill )
For Each objProcess in colProcess
objProcess.Terminate()
Next
'WSCript.Echo "Just killed process " & strProcessKill _
'& " on " & strComputer

Set colFolders = objWMIService.ExecQuery _
    ("Select * from Win32_Directory where Name = 'C:\\Program Files\\Smart Label'")

'Delete Folder
For Each objFolder in colFolders
    errResults = objFolder.Delete
Next

Set colFolders = objWMIService.ExecQuery _
    ("Select * from Win32_Directory where Name = 'c:\\Program Files\\Seiko Instruments USA Inc\\Smart Label Printer 6.1\\OEMPRINT\\i386'")

For Each objFolder in colFolders
    errResults = objFolder.Delete

Next

Set colFolders = objWMIService.ExecQuery _
    ("Select * from Win32_Directory where Name = 'c:\\Program Files\\Seiko Instruments USA Inc\\Smart Label Printer 6.1\\OEMPRINT'")

For Each objFolder in colFolders
    errResults = objFolder.Delete

Next

Set colFolders = objWMIService.ExecQuery _
    ("Select * from Win32_Directory where Name = 'c:\\Program Files\\Seiko Instruments USA Inc\\Smart Label Printer 6.1'")

For Each objFolder in colFolders
    errResults = objFolder.Delete

Next

Set colFolders = objWMIService.ExecQuery _
    ("Select * from Win32_Directory where Name = 'c:\\Program Files\\Seiko Instruments USA Inc'")

'Delete Folder
For Each objFolder in colFolders
    errResults = objFolder.Delete

Next

Set colFoldersS = objWMIService.ExecQuery _
    ("Select * from Win32_Directory where Name = 'C:\\Windows\\Seiko'")

For Each objFolder in colFoldersS
    errResults = objFolder.Delete

Next

'Delete File
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile("C:\documents and settings\" & result(1) &"\Start Menu\Programs\Startup\SmartCapture.lnk")

'$$$$$$$$$

Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\default:StdRegProv")
objArgs = "Software\Seiko Instruments USA Inc."
objArgs1 = "SOFTWARE\Seiko Instruments"

DeleteRegistryKey HKCU, objArgs
DeleteRegistryKey HKLM, objArgs1

MsgBox "Done…"

Sub DeleteRegistryKey(ByVal sHive, ByVal sKey)
Dim aSubKeys, sSubKey, iRC
'On Error Resume Next
iRC = oReg.EnumKey(sHive, sKey, aSubKeys)
If iRC = 0 And IsArray(aSubKeys) Then
For Each sSubKey In aSubKeys
If Err.Number <> 0 Then
Err.Clear
Exit Sub
End If
'Wscript.Echo sHive, sKey & "\" & sSubKey & " From Sub"
DeleteRegistryKey sHive, sKey & "\" & sSubKey
Next
End If
oReg.DeleteKey sHive, sKey
End Sub

———-COPY EVERYTHING ABOVE THIS LINE———-

 

NOTE: Edited on 5/3/07 Added:

1. A new registry key to delete
2. Stop SLPMONX service

PLEASE MAKE SURE NO WORD WRAPPING IS HAPPENING IN YOUR SCRIPT!!!

To make this script work you will need one things!

1. You will need to have Admin privlidges on the target computer.

This information is provided "AS IS" with no warranties expressed or implied.

Leave a Reply

Your email address will not be published. Required fields are marked *