alex1604
Goto Top

Script nur als consolen session ausführen?! Wie?

Hallo Zusammen,

ich plane folgedes:

Ich möchte auf einem Windows 2003 Server ein script nur dann automatisch ausführen, wenn ich über die console angemeldet bin.

Weiss jemand wie es geht?

vielen dank vorab

MfG
Alex

Content-Key: 83493

Url: https://administrator.de/contentid/83493

Printed on: April 24, 2024 at 07:04 o'clock

Member: alex1604
alex1604 Apr 02, 2008 at 09:14:34 (UTC)
Goto Top
Hi,

habe das problem wie folgt gelösst face-smile

@echo off
@title [ARN] International GERHSRV01 Crash Debugging Script
@color 4F

rem [ARN] International GERHSRV01 Crash Debugging Script
rem (c) 2008 [ARN] International


if %SESSIONNAME%==Console taskkill /IM "server_windows.exe"
if %SESSIONNAME%==Console net stop "MYSQL"
if %SESSIONNAME%==Console net stop "SQLSERV"
if %SESSIONNAME%==Console net stop "Apache2.2"
if %SESSIONNAME%==Console net stop "Microsoft Exchange IMAP4"
if %SESSIONNAME%==Console net stop "Cron Service (CRONw)"
if %SESSIONNAME%==Console net stop "DNS Server"
if %SESSIONNAME%==Console net stop "Simple Mail Transfer Protocol (SMTP)"
if %SESSIONNAME%==Console net stop "Microsoft Exchange POP3"
if %SESSIONNAME%==Console net stop "Microsoft Exchange Routing Engine"
if %SESSIONNAME%==Console net stop "Microsoft Exchange Information Store" /y
if %SESSIONNAME%==Console net stop "World Wide Web Publishing Service"
if %SESSIONNAME%==Console net stop "IIS Admin Service" /y
if %SESSIONNAME%==Console net stop "Update Services"
echo Services will restart now!
if %SESSIONNAME%==Console net start "MYSQL"
if %SESSIONNAME%==Console net start "SQLSERV"
if %SESSIONNAME%==Console start H:\Programs\Teamspeak\server_windows.exe
if %SESSIONNAME%==Console net start "Apache2.2"
if %SESSIONNAME%==Console net start "Cron Service (CRONw)"
if %SESSIONNAME%==Console net start "Microsoft Exchange Information Store"
if %SESSIONNAME%==Console net start "Microsoft Exchange Calendar Connector"
if %SESSIONNAME%==Console net start "Microsoft Exchange Event"
if %SESSIONNAME%==Console net start "Microsoft Exchange POP3"
if %SESSIONNAME%==Console net start "Microsoft Exchange Routing Engine"
if %SESSIONNAME%==Console net start "Microsoft Exchange IMAP4"
if %SESSIONNAME%==Console net start "DNS Server"
if %SESSIONNAME%==Console net start "Simple Mail Transfer Protocol (SMTP)"
if %SESSIONNAME%==Console net start "IIS Admin Service"
if %SESSIONNAME%==Console net start "World Wide Web Publishing Service"
if %SESSIONNAME%==Console net start "FTP Publishing Service"
if %SESSIONNAME%==Console net start "Update Services"
if %SESSIONNAME%==Console start C:\TSPerl\ts2perlmod\ts2perlmod.pl
eventcreate /t information /id 167 /d "Custom: [ARN] International GERHSRV01 Crash Debugging Script Services Sucessfully Restarted on GERHSRV01"