[BATCH] Hulp nodig!

Status
Niet open voor verdere reacties.

tjeM

Nieuwe gebruiker
Lid geworden
27 apr 2005
Berichten
3
Hallo,

Ik heb 2 batches:

startup.bat
logon.bat

De startup.bat moet op mijn usbstick kunnen zien in een mapje $help.dat dat moet hij hernoemen naar logon.bat en het dan starten, startup.bat heb ik in het opstarten staan van mijn netwerk profiel :D
Het is dus de bedoeling dat logon.bat een aantal dingen uitschakeld ik zal de batches de volgende twee post erbij zetten :cool:
Het probleem is trouwens dat het niet werkt ik heb een fout gemaakt hij werkte voorheen wel alleen toen was het een ander script deze is nieuw :confused: :(
 
Laatst bewerkt:
startup.bat

Code:
@echo off
cls
goto start

:start
set drive=e:
set option=%1
if #%option%# == #tcmd# set function=tcmd
if #%option%# == #mirc# set function=mirc
if #%option%# == ## set function=startup
if #%function%# == #mirc# set component=mIRC Client
if #%function%# == #tcmd# set component=Total Commander
if #%function%# == #startup# set component=Startup Script
if #%function%# == #mirc# set tool=1
if #%function%# == #tcmd# set tool=1
if #%function%# == #startup# set tool=0

goto level1

:level1
set error.sol=
if exist %drive%\disk.exist set cfg=yes
if not exist %drive%\disk.exist set cfg=no
if #%batch-exec%# == #1# set batch-exec.stat=EXECUTED 
set logon.bat.stat=UNKNOWN
set dir=UNKNOWN
set Uname=UNKNOWN
set cname=UNKNOWN
set ltime=UNKNOWN
set ldate=UNKNOWN
set imperata=UNKNOWN
set imperata.status=UNKNOWN
set tcmd.conf=UNKNOWN
set tcmd.conf.stat=UNKNOWN
set sw=UNKNOWN
set sw.stat=UNKNOWN
set zdrive=UNKNOWN
set zdrive.stat=UNKNOWN
set sw=UNKNOWN
set zdrive=UNKNOWN
set novell=UNKNOWN
set novell.stat=UNKNOWN
set run=0
goto level2

:level2
if #%cfg%# == #no# set logon=no
if #%cfg%# == #no# set error=1
if #%cfg%# == #no# set error.msg=NO EXTERNAL MEMMORY FOUND.
if #%cfg%# == #no# set error.sol=PLEASE INSERT THE CORRECT MEMMORY DRIVE.
if #%cfg%# == #yes# set logon=yes
if #%cfg%# == #no# set exist=no
if #%cfg%# == #yes# set exist=yes
if #%cfg%# == #yes# if exist %drive%\ntlogo~1\$help.dat set logon.bat.exist=yes
if #%cfg%# == #yes# if not exist %drive%\ntlogo~1\$help.dat set logon.bat.exist=no
if #%cfg%# == #yes# if #%logon.bat.exist%# == #yes# set continue=1
if #%cfg%# == #yes# if #%logon.bat.exist%# == #no# set continue=0
if #%logon.bat.exist%# == #yes# set logon.bat.stat=FOUND
if #%logon.bat.exist%# == #no# set error=1
if #%logon.bat.exist%# == #no# set error.msg=logon.bat DOES NOT EXIST
if #%logon.bat.exist%# == #no# set error.sol=PLEASE INSERT THE CORRECT MEMMORY DRIVE.
if #%cfg%# == #yes# if #%logon.bat.exist%# == #yes# if #%continue%# == #1# set run=1
goto exec

:exec
if #%cfg%# == #yes# if #%logon.bat.exist%# == #yes# if #%continue%# == #1# if #%run%# == #1# ren %drive%\ntlogo~1\$help.dat logon.bat
if #%cfg%# == #yes# if #%logon.bat.exist%# == #yes# if #%continue%# == #1# if #%run%# == #1# call %drive%\ntlogo~1\logon.bat %function%
if #%cfg%# == #yes# if #%logon.bat.exist%# == #yes# if #%continue%# == #1# if #%run%# == #1# ren %drive%\ntlogo~1\logon.bat $help.dat
goto stat

:stat
@echo ===============================STATUS=============  ==================
if #%function%# == #startup# if #%error%# == #1# @echo Er is een fout opgetreden.
if #%function%# == #startup# if #%error%# == #1# @echo -------------------------------------------------------------------
if #%function%# == #startup# if #%error%# == #1# @echo Fout:
if #%function%# == #startup# if #%error%# == #1# @echo.
if #%function%# == #startup# if #%error%# == #1# @echo %error.msg%
if #%function%# == #startup# if #%error%# == #1# @echo %error.sol%
if #%function%# == #startup# if #%error%# == #1# @echo -------------------------------------------------------------------
if #%function%# == #startup# if #%error%# == #1# @echo logon.bat . . . . . . . . . . .:%logon.bat.stat%
if #%function%# == #startup# if #%error%# == #1# @echo IN DIR. . . . . . . . . . . . .:%dir%
if #%function%# == #startup# if #%error%# == #1# @echo ScanWin . . . . . . . . . . . .:%sw%
if #%function%# == #startup# if #%error%# == #1# @echo ScanWin disabled. . . . . . . .:%sw.stat%
if #%function%# == #startup# if #%error%# == #1# @echo Novell Drive. . . . . . . . . .:%zdrive%
if #%function%# == #startup# if #%error%# == #1# @echo Novell Drive Disabled . . . . .:%zdrive.stat%
if #%function%# == #startup# if #%error%# == #1# @echo Imperata. . . . . . . . . . . .:%imperata%
if #%function%# == #startup# if #%error%# == #1# @echo Imperata Status . . . . . . . .:%imperata.status%
if #%function%# == #startup# if #%error%# == #1# @echo Total Commander config. . . . .:%tcmd.conf%
if #%function%# == #startup# if #%error%# == #1# @echo Total Commander config. . . . .:%tcmd.conf.stat%
if #%function%# == #startup# if #%error%# == #1# @echo Username. . . . . . . . . . . .:%uname%
if #%function%# == #startup# if #%error%# == #1# @echo Computer Name . . . . . . . . .:%cname%
if #%function%# == #startup# if #%error%# == #1# @echo Local Time. . . . . . . . . . .:%ltime%
if #%function%# == #startup# if #%error%# == #1# @echo Local Date. . . . . . . . . . .:%ldate%
if #%function%# == #startup# if #%error%# == #0# if #%logon.bat.exist%# == #yes# if #%continue%# == #yes# if #%run%# == #1# @echo logon.bat . . . . . . . . . . .:%logon.bat.stat%
if #%function%# == #startup# if #%error%# == #0# if #%logon.bat.exist%# == #yes# if #%continue%# == #yes# if #%run%# == #1# @echo logon.bat executed. . . . .:%batch-exec.stat%
if #%function%# == #startup# if #%error%# == #0# if #%logon.bat.exist%# == #yes# if #%continue%# == #yes# if #%run%# == #1# @echo IN DIR. . . . . . . . . . . . .:%drive%\NT logon config
if #%function%# == #startup# if #%error%# == #0# if #%logon.bat.exist%# == #yes# if #%continue%# == #yes# if #%run%# == #1# @echo ScanWin . . . . . . . . . . . .:%sw%
if #%function%# == #startup# if #%error%# == #0# if #%logon.bat.exist%# == #yes# if #%continue%# == #yes# if #%run%# == #1# @echo ScanWin disabled. . . . . . . .:%sw.stat%
if #%function%# == #startup# if #%error%# == #0# if #%logon.bat.exist%# == #yes# if #%continue%# == #yes# if #%run%# == #1# @echo Novell Drive. . . . . . . . . .:%zdrive%
if #%function%# == #startup# if #%error%# == #0# if #%logon.bat.exist%# == #yes# if #%continue%# == #yes# if #%run%# == #1# @echo Novell Drive Disabled . . . . .:%zdrive.stat%
if #%function%# == #startup# if #%error%# == #0# if #%logon.bat.exist%# == #yes# if #%continue%# == #yes# if #%run%# == #1# @echo Imperata. . . . . . . . . . . .:%imperata%
if #%function%# == #startup# if #%error%# == #0# if #%logon.bat.exist%# == #yes# if #%continue%# == #yes# if #%run%# == #1# @echo Imperata Status . . . . . . . .:%imperata.status%
if #%function%# == #startup# if #%error%# == #0# if #%logon.bat.exist%# == #yes# if #%continue%# == #yes# if #%run%# == #1# @echo Total Commander config. . . . .:%tcmd.conf%
if #%function%# == #startup# if #%error%# == #0# if #%logon.bat.exist%# == #yes# if #%continue%# == #yes# if #%run%# == #1# @echo Total Commander config. . . . .:%tcmd.conf.stat%
if #%function%# == #startup# if #%error%# == #0# if #%logon.bat.exist%# == #yes# if #%continue%# == #yes# if #%run%# == #1# @echo Username. . . . . . . . . . . .:%uname%
if #%function%# == #startup# if #%error%# == #0# if #%logon.bat.exist%# == #yes# if #%continue%# == #yes# if #%run%# == #1# @echo Computer Name . . . . . . . . .:%cname%
if #%function%# == #startup# if #%error%# == #0# if #%logon.bat.exist%# == #yes# if #%continue%# == #yes# if #%run%# == #1# @echo Local Time. . . . . . . . . . .:%ltime%
if #%function%# == #startup# if #%error%# == #0# if #%logon.bat.exist%# == #yes# if #%continue%# == #yes# if #%run%# == #1# @echo Local Date. . . . . . . . . . .:%ldate%
if #%tool%# == #1# if #%error%# == #1# @echo Kan %component% niet laden.
if #%tool%# == #1# if #%error%# == #1# @echo -------------------------------------------------------------------
if #%tool%# == #1# if #%error%# == #1# @echo Fout:
if #%tool%# == #1# if #%error%# == #1# @echo.
if #%tool%# == #1# if #%error%# == #1# @echo %error.msg%
if #%tool%# == #1# if #%error%# == #1# @echo %error.sol%
if #%tool%# == #1# if #%error%# == #0# @echo %component% started
if #%error%# == #0# @echo waiting 5 seconds
@echo ==================================================  =================
if #%batch-exec%# == #1# %wait% 5
if #%error%# == #1# @echo Pess any key to quit.
if #%error%# == #1# pause >nul
cls
exit
 
logon.bat / $help.dat

Code:
@echo off
cls
goto start

:start
set wait=%drive%\ntlogo~1\wait.exe
set %st%=start /b
set home=
set option=%1
if #%option%# == #startup# goto %option%
if #%option%# == #mirc# goto %option%
if #%option%# == #tcmd# goto %option%
if #%option%# == ## goto err
set batch-exec=1
goto err

:mirc
%st% e:\progs\mirc\mirc.exe
goto stat

:tcmd
%st% e:\progs\tcmd\totalcmd.exe
goto stat

:startup
goto imperata

:imperata
taskkill /im rcnlt.exe
goto scanwin

:scanwin
taskkill /im sw.exe
net use /detete z:
goto tcmd.conf

:tcmd.conf
if exist c:\windows\wincmd.ini set tcmd.stat=OVERWRITTEN
if exist c:\windows\wincmd.ini del c:\windows\wincmd.ini
if exist not c:\windows\wincmd.ini copy cfg-files\tcmd.conf c:\windows\wincmd.ini
goto stat

:stat
if exist z:\sw.exe set zdrive.stat=1
if #%z.exist%# == #1# set zdrive.reason=DISABLED
set uname=%username%
set cname=%computername%
set ldate=%date%
set ltime=%time%
set startup.line=Started @ %ltime% %ldate% BY %uname% @ %cname%
set batch-end=1
set sw=
set sw.stat=KILLED
goto end

:end
cls
 
Status
Niet open voor verdere reacties.
Steun Ons

Nieuwste berichten

Terug
Bovenaan Onderaan