Page 1 of 1 1
Topic Options
#119456 - 2004-05-12 10:48 PM Calling a bat file from a kix script
pgoss Offline
Fresh Scripter

Registered: 2004-05-12
Posts: 5
I have dug around for this but cannot find anything definitive. I am trying to call a SMS bat file from a kix script. I am in a NT4 domain with all users running a logon.bat file that calls the kix script. From the kix script i wish to call the sms bat file to remove the sms client. Here is the script, i am able to map the drives correctly but it's the sms bat file i am having problems with Code:
;REM MAP DRIVE FOR J, K, and O drive mapping
IF INGROUP ("EDCTEST\Domain Users")
USE K: /DELETE /PERSISTENT
USE K: "\\DC1\FS2" /PERSISTENT
USE J: /DELETE /PERSISTENT
USE J: "\\dc1\FS1" /PERSISTENT
USE o: /DELETE /PERSISTENT
USE o: "\\dc1\oracle" /PERSISTENT
ENDIF

IF INGROUP ("EDCTEST\smsremove")
CALL \\sms20\sp\i386\20clicln.bat

ENDIF


EXIT


Top
#119457 - 2004-05-12 10:53 PM Re: Calling a bat file from a kix script
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
Have you tried something like....

RUN '\\sms20\sp\i386\20clicln.bat'

??

I think CALL is used to start other kix scripts.

Top
#119458 - 2004-05-12 11:04 PM Re: Calling a bat file from a kix script
pgoss Offline
Fresh Scripter

Registered: 2004-05-12
Posts: 5
Well i would love to thank you for pointing out what a moron i am!! yikes, i had tried the run cmd but i forgot the quotation marks and then i just kept forgetting them....
Top
#119459 - 2004-05-12 11:17 PM Re: Calling a bat file from a kix script
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
No problem. Lets us know if you come across anymore obstacles.
Top
#119460 - 2004-05-12 11:19 PM Re: Calling a bat file from a kix script
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
Just an FYI to help further the removal process

SMS: How to Remove a Systems Management Server 2.0 Client
http://support.microsoft.com/default.aspx?scid=kb;EN-US;199078

http://www.myitforum.com/articles/11/view.asp?id=5184

http://www.enterpriseitplanet.com/resources/scripts_sms/article.php/3084061


Top
#119461 - 2004-05-13 12:30 AM Re: Calling a bat file from a kix script
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
this is funny, I just did this today (i can't remember the path though)

if exist('%windir%\msapps\ms\bin\clicore.exe')
? 'Please wait for SMS removal to complete (about 3 minutes)'
shell 'cmd /c '+$server+'/smsremove/20clicln.bat /scrub'
endif
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#119462 - 2004-05-13 12:52 AM Re: Calling a bat file from a kix script
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
There is a remote CLiClean that can be run from a central place to remove the clients faster than the local version.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#119463 - 2004-05-13 05:18 AM Re: Calling a bat file from a kix script
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
Do you have a link to this utility you're speaking of Les? Or an exact name of the utility.

I know there is a file like CLEANSMS.EXE (or something like that, not a work right now to check the real name of the file) but it is not for remote either.

The link to the .vbs script I gave does it (or could easily be done) remotely without any EXE or BAT files. I'm sure it could easily be converted to KiXtart if wanted.

Top
#119464 - 2004-05-13 02:32 PM Re: Calling a bat file from a kix script
pgoss Offline
Fresh Scripter

Registered: 2004-05-12
Posts: 5
Quote:

SMS: How to Remove a Systems Management Server 2.0 Client
http://support.microsoft.com/default.aspx?scid=kb;EN-US;199078




Just an FYI, removing the subnet range from the boundaries (Option 3 I think) does not remove the client from the workstation. Currently I am going to do a combo of a few things, the smsman.exe with a couple of switches (/u /q to be exact) and then I am going to use the 20clicln.bat. The VBS script looks very promising though; I might have to spend some time looking into using that. Guys thanks for all the help!

Top
#119465 - 2004-05-13 03:33 PM Re: Calling a bat file from a kix script
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
uninstalls
del user accts
del profile folders

tested only on win2k (the only hardcoded path is C:\Documents and Settings\)

Code:
 
; ****************************** Uninstall SMS Client ******************************************
if exist('%SMS_LOCAL_DIR%\ms\sms\core\bin\clicore.exe')
? ' Removing SMS Client. Please wait (up to 3-5 minutes)...' ?
Shell "cmd /c "+$setup+"\smsclientclean\20CLICLN.BAT /scrub"
? ' Removing SMS User Accounts...'
$oDomain = GetObject("WinNT://"+@wksta)
$oUser = $oDomain.Delete("user", 'SMSCliSvcAcct&')
$oUser.SetInfo
$oUser = $oDomain.Delete("user", 'SMSCliToknAcct&')
$oUser.SetInfo
? ' Removing SMS Profile folders...'
$fs=CreateObject("Scripting.FileSystemObject")
for each $folder in FolderList('C:\Documents and Settings','smsc')
$fo=$fs.GetFolder("C:\Documents and Settings\"+$folder)
$fo.Delete("true")
next
endif



Function FolderList($folderName,optional $mask)
dim $objDir, $objFld, $objFile, $t, $name
$objDir = CreateObject('Scripting.FileSystemObject')
if @error Exit 1 Endif
$objFld = $objDir.GetFolder($folderName).SubFolders
if @error exit 2 endif ; usually folder not found
For Each $objFile In $objFld
$name=$objFile.name
if ($mask and instr($name,$mask)) or not $mask
$t=$t+'|'+$name
endif
Next
$FolderList=split(substr($t,2),'|')
$objDir = 0
EndFunction

_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#119466 - 2004-05-13 04:59 PM Re: Calling a bat file from a kix script
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Quote:

Do you have a link to this utility you're speaking of Les?



It is SMSClean.exe, part of the SMS Tools collection.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 484 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.057 seconds in which 0.023 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org