Page 1 of 1 1
Topic Options
#121894 - 2004-06-28 06:02 PM Call another batch file
dwheeler Offline
Fresh Scripter

Registered: 2004-06-28
Posts: 8
I am new to this so forgive me if this questions seems stupid. I am trying call another batch file from a script that has been created but it refuses to work. The script checks a few things, maps a few network drives and then I want it to run a batch file that checks to see if the McAfee epolicy agent has been installed, and if not, then install it. Is it possible to do this and if so what is the syntax?

Thanks

Top
#121895 - 2004-06-28 06:06 PM Re: Call another batch file
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
shell '\\server\share\folder\file.bat'

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

Top
#121896 - 2004-06-28 06:21 PM Re: Call another batch file
dwheeler Offline
Fresh Scripter

Registered: 2004-06-28
Posts: 8
That doesn't seem to do anything. Rest of the script runs but it just seems to ignore the calling of the batch file.
Top
#121897 - 2004-06-28 06:27 PM Re: Call another batch file
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
why dont you post your code..it would make it much easier for us to help you
Top
#121898 - 2004-06-28 06:32 PM Re: Call another batch file
dwheeler Offline
Fresh Scripter

Registered: 2004-06-28
Posts: 8
Here is the code. Trying to call the file epo.bat.

;***************************************************
;
; Main Kixtart script
;
;***************************************************

cls

If @INWIN = 1
shell "TITLE Eclipse Marketing Services"
shell "ipconfig /renew"
else
shell "winipcfg /renew_all"
endif

$lfcr = chr(10) + chr(13)

?@FULLNAME + " On " + @LSERVER
?"Welcome to the Eclipse Marketing Services Network"

if (@WKSTA <> "TSERVER")
or ((@WKSTA = "TSERVER") and (ingroup("Energis Users")))
$msg = "Users of Eclipse Marketing Services computing resources must respect software copyrights and licenses, "
$msg = $msg + "respect the integrity of computer-based information resources, refrain from seeking to gain unauthorised access, "
$msg = $msg + "and respect the rights of other computer users."
$msg = $msg + $lfcr + $lfcr
$msg = $msg + "This Policy covers appropriate use of computers, networks, and information contained therein. "
$msg = $msg + "If abuse of computer systems occurs, those responsible for such abuse are held accountable and may be subject to disciplinary action. Report any abuse of computer systems and resources to the Operations Director."
$msg = $msg + $lfcr + $lfcr
$msg = $msg + "The Data Security Policy Document provides guidelines for the appropriate and inappropriate use of computer resources. "
$msg = $msg + "Copies of this document are available from the Systems Department."
$msg = $msg + $lfcr + $lfcr
$msg = $msg + "DO YOU ACCEPT THESE CONDITIONS?"

$selection = messagebox ($msg,"System Data Security Policy", 4+48+256+4096, 20)
else
$selection = 6
endif

if $selection = 6
select
case ingroup("Administrators")
call "DrvAdministrators.kix"
case ingroup("Systems Department")
call "DrvSystems.kix"
case ingroup("Client Services")
call "DrvClientServices.kix"
case ingroup("Production")
call "DrvProduction.kix"
case ingroup("Office Admin")
call "DrvOfficeAdmin.kix"
case ingroup("Acc")
call "DrvAccounts.kix"
case ingroup("Call Centre")
call "DrvCallCentre.kix"
case ingroup("DataCapture")
call "DrvDataCapture.kix"
case ingroup("MailRoom")
call "DrvMailRoom.kix"
case ingroup("Energis Users")
call "DrvEnergis.kix"
endselect
else
big
color r+/n
?" ACCESS"
?" DENIED"
sleep 1
BEEP
BEEP
BEEP
color n/n
small
$RC = logoff(1)
endif

if (@WKSTA <> "TSERVER")
shell "\\eclipsefs\netlogon$\epo.bat"
endif

settime "\\eclipseFS"

Top
#121899 - 2004-06-28 06:44 PM Re: Call another batch file
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Try doubling up the "$"...

Code:

if (@WKSTA <> "TSERVER")
shell "\\eclipsefs\netlogon$$\epo.bat"
endif


Top
#121900 - 2004-06-28 06:57 PM Re: Call another batch file
dwheeler Offline
Fresh Scripter

Registered: 2004-06-28
Posts: 8
Sorry, still not working. Same thing happening, rest of the script is running but still seems to be ignoring the calling of batch file.
Top
#121901 - 2004-06-28 07:02 PM Re: Call another batch file
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
run it seperately in a blank script

make the first line in the bat a 'echo found me' line so it will display something
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#121902 - 2004-06-28 07:02 PM Re: Call another batch file
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
then verify path/name and permissions
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#121903 - 2004-06-28 07:13 PM Re: Call another batch file
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
perhaps it would be easier to just do whatever the epo.bat is doing within the kix script?
Top
#121904 - 2004-06-28 09:23 PM Re: Call another batch file
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
What is the content of the EPO.BAT?

BTW, why are you doing the following?
Code:

shell "\\eclipsefs\netlogon$$\epo.bat"



Shouldn't it not be -
Code:

shell "\\eclipsefs\netlogon\epo.bat"



The NETLOGON share (in my experience) has been that the NETLOGON share is not hidden.

So.. Really what you could do is the following-
Code:

shell @SCRIPTDIR+"\epo.bat"



Kent


Edited by kdyer (2004-06-28 09:26 PM)
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#121905 - 2004-06-29 07:04 AM Re: Call another batch file
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
BATch files are DOS. You need to include %COMSPEC%.
Code:
shell "%COMSPEC% /C \\eclipsefs\netlogon$$\epo.bat"  

_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#121906 - 2004-06-29 11:56 AM Re: Call another batch file
dwheeler Offline
Fresh Scripter

Registered: 2004-06-28
Posts: 8
Have worked out what the problem was, it was a mistake in the epo.bat file that was causing the problem. The command shell "\\eclipsefs\netlogon\epo.bat" calls the batch file fine and now the correct syntax is in the batch file it runs OK (I had an incorrect path name). Thanks for the help guys.
Top
#121907 - 2004-06-29 02:39 PM Re: Call another batch file
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Can you post the contents of EPO.BAT?

Thanks,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#121908 - 2004-06-29 05:13 PM Re: Call another batch file
dwheeler Offline
Fresh Scripter

Registered: 2004-06-28
Posts: 8
Certainly can:

IF EXIST "C:\PROGRAM FILES\NETWORK ASSOCIATES\COMMON FRAMEWORK\FRAMEWORKSERVICE.EXE" GOTO :END_BATCH
\\ECLIPSEFS\netlogon\FRAMEPKG.EXE /FORCEINSTALL /INSTALL=AGENT
:END_BATCH

Top
#121909 - 2004-06-29 07:28 PM Re: Call another batch file
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
You know that batch file code could easily be included in the kix script, eliminating the bat all together. Something as easy as..

Code:
If Not Exist ("C:\PROGRAM FILES\NETWORK ASSOCIATES\COMMON FRAMEWORK\FRAMEWORKSERVICE.EXE")
Shell '\\ECLIPSEFS\netlogon\FRAMEPKG.EXE /FORCEINSTALL /INSTALL=AGENT'
Endif



instead of..

Code:
shell "\\eclipsefs\netlogon\epo.bat"


Top
Page 1 of 1 1


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

Who's Online
1 registered (Henriques) and 2516 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.078 seconds in which 0.034 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