Page 1 of 1 1
Topic Options
#191505 - 2008-12-30 07:45 PM calling a .vbs and .bat inside a .bat that calls a kix file
Louie77 Offline
Just in Town

Registered: 2008-12-30
Posts: 4
Loc: Indianapolis IN
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?
_________________________
Louie

Top
#191507 - 2008-12-30 08:38 PM Re: calling a .vbs and .bat inside a .bat that calls a kix file [Re: Louie77]
Louie77 Offline
Just in Town

Registered: 2008-12-30
Posts: 4
Loc: Indianapolis IN
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
_________________________
Louie

Top
#191527 - 2008-12-30 10:56 PM Re: calling a .vbs and .bat inside a .bat that calls a kix file [Re: Louie77]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4447
Loc: USA
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.
Top
#191531 - 2008-12-31 01:15 PM Re: calling a .vbs and .bat inside a .bat that calls a kix file [Re: Allen]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4285
Loc: New Jersey
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
_________________________
Actually I am a Rocket Scientist! \:D

Top
#191535 - 2008-12-31 07:48 PM Re: calling a .vbs and .bat inside a .bat that calls a kix file [Re: Glenn Barnas]
Louie77 Offline
Just in Town

Registered: 2008-12-30
Posts: 4
Loc: Indianapolis IN
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
_________________________
Louie

Top
#191536 - 2008-12-31 07:50 PM Re: calling a .vbs and .bat inside a .bat that calls a kix file [Re: Louie77]
Louie77 Offline
Just in Town

Registered: 2008-12-30
Posts: 4
Loc: Indianapolis IN
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
_________________________
Louie

Top
#191537 - 2008-12-31 11:02 PM Re: calling a .vbs and .bat inside a .bat that calls a kix file [Re: Louie77]
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
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.
_________________________
Today is the tomorrow you worried about yesterday.

Top
#191619 - 2009-01-05 08:37 PM Re: calling a .vbs and .bat inside a .bat that calls a kix file [Re: Gargoyle]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11567
Loc: CA
I like this better myself.

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

Top
#191636 - 2009-01-05 10:30 PM Re: calling a .vbs and .bat inside a .bat that calls a kix file [Re: NTDOC]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22333
Loc: OK
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.
_________________________
!

download KiXnet

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 36 anonymous users online.
Newest Members
thequeen, ameliaryan, shalomsalami, dkdssdk, Vroon
17639 Registered Users

Generated in 0.034 seconds in which 0.01 seconds were spent on a total of 13 queries. Zlib compression enabled.

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