Louie77
(Just in Town)
2008-12-30 07:45 PM
calling a .vbs and .bat inside a .bat that calls a kix file

Hello all I’m pretty new at this Kix32.exe stuff and new to the company I work for as well.

I need to be able to call a .vbs and a .cmd from my login.bat
This is what I have done so far

In my login batch this is what it looks like but it seems no to work

run "\\nadc\netlogon\B7checker.vbs"
run "\\nadc\netlogon\JDE.bat"
@ECHO OFF
%0\..\Kix32.exe %0\..\kixtart.kix

I have all my scripts in the same folder in other words

B7checker.vbs
JDE.bat
Login.bat
Kixtart.kix

All live in netlogon

I’ve even tried doing this on the login.bat file

Script b7checker.vbs
@ECHO OFF
%0\..\Kix32.exe %0\..\kixtart.kix
But that doesn’t work

Any clues as to what am I doing wrong?


Louie77
(Just in Town)
2008-12-30 08:38 PM
Re: calling a .vbs and .bat inside a .bat that calls a kix file

this is what my login.bat looks like

shell "\\nadc01\netlogon\B7checker.vbs"
shell "\\nadc01\netlogon\JDE.bat"
@ECHO OFF
%0\..\Kix32.exe %0\..\kixtart.kix

any help is greatly appreciated


AllenAdministrator
(KiX Supporter)
2008-12-30 10:56 PM
Re: calling a .vbs and .bat inside a .bat that calls a kix file

So what is so special about those vbs and batch files? If you post the contents of those, I'd bet we can just convert everything to kix.

Glenn BarnasAdministrator
(KiX Supporter)
2008-12-31 01:15 PM
Re: calling a .vbs and .bat inside a .bat that calls a kix file

Where is kix32.exe?

You are using LOGIN.BAT, but the RUN/SHELL statements are Kix commands, not CMD commands (should be "CALL JDE.BAT" and "CSCRIPT B7CHECKER.VBS").

Like Allen said - if you post your batch, Kix, and VB scripts, we can probably help convert all to a single Kix script.

Glenn


Louie77
(Just in Town)
2008-12-31 07:48 PM
Re: calling a .vbs and .bat inside a .bat that calls a kix file

here is all I had to do in the logon.bat


@ECHO OFF
B7checker.vbs
JDE.bat
%0\..\Kix32.exe %0\..\kixtart.kix

and all is perfect
so I guess there is really no need to add the shell or cscript
thanks


Louie77
(Just in Town)
2008-12-31 07:50 PM
Re: calling a .vbs and .bat inside a .bat that calls a kix file

here is the vb
On Error Resume Next

Set objShell = CreateObject("WScript.Shell")
strUserName = objShell.ExpandEnvironmentStrings("%username%")
strComputerName = objShell.ExpandEnvironmentStrings("%computername%")


'Customize these variables
strFolder = "C:\B7"
strEmailFrom = "user@domain.com"
strEmailTo = "user2@domain.com"
strEmailSubject = "Folder " & strFolder & " found on " & strUserName
strEmailBody = "Folder " & strFolder & " found on " & strComputerName
strSMTP = "exch-internal.int"

Set objFSO = CreateObject("Scripting.FileSystemObject")

If objFSO.FolderExists(strFolder) Then
Set objEmail = CreateObject("CDO.Message")

objEmail.From = strEmailFrom
objEmail.To = strEmailTo
objEmail.Subject = strEmailSubject
objEmail.Textbody = strEmailBody
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
strSMTP
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Update

objEmail.Send
End If


Gargoyle
(MM club member)
2008-12-31 11:02 PM
Re: calling a .vbs and .bat inside a .bat that calls a kix file

The B7checker.vbs file. All this is doing is checking if a directory exists and sends an email out to whomever user2 is.

Much easier way.... (IMHO)

 Code:
If exist("C:\B7")  
  Open (1,"\\Server\Admin_Logs\"+@Wksta+"_"+@UserID+".txt",5)
  Writeline (1,"B7 directory found on "+@date+@crlf)
  Close (1)
EndIf


No nasty emails, and a central location for reviewing the log files. And you can see how long it takes to get rid of the B7 directory.


NTDOCAdministrator
(KiX Master)
2009-01-05 08:37 PM
Re: calling a .vbs and .bat inside a .bat that calls a kix file

I like this better myself.

 Code:
If GetFileAttr('C:\B7') & 16
  ;Folder exists
EndIf


LonkeroAdministrator
(KiX Master Guru)
2009-01-05 10:30 PM
Re: calling a .vbs and .bat inside a .bat that calls a kix file

I can see where gargoyle's code might fail.
but just change:
If exist("C:\B7")
to:
If exist("C:\B7\")

should fix the issue.