#121894 - 2004-06-28 06:02 PM
Call another batch file
|
dwheeler
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
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
shell '\\server\share\folder\file.bat'
|
|
Top
|
|
|
|
#121896 - 2004-06-28 06:21 PM
Re: Call another batch file
|
dwheeler
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
|
|
|
|
#121898 - 2004-06-28 06:32 PM
Re: Call another batch file
|
dwheeler
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.
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
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
   
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
|
|
Top
|
|
|
|
#121902 - 2004-06-28 07:02 PM
Re: Call another batch file
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
then verify path/name and permissions
|
|
Top
|
|
|
|
#121904 - 2004-06-28 09:23 PM
Re: Call another batch file
|
Kdyer
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)
|
|
Top
|
|
|
|
#121906 - 2004-06-29 11:56 AM
Re: Call another batch file
|
dwheeler
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
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Can you post the contents of EPO.BAT?
Thanks,
Kent
|
|
Top
|
|
|
|
#121908 - 2004-06-29 05:13 PM
Re: Call another batch file
|
dwheeler
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
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
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(Henriques)
and 2516 anonymous users online.
|
|
|