|
|
|||||||
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? |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
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. |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
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. |
||||||||
|
|
|||||||
I like this better myself. Code: If GetFileAttr('C:\B7') & 16 ;Folder exists EndIf |
||||||||
|
|
|||||||
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. |