Batch Datei: Per Tastendruck ein Programm öffnen?
Hallo ich habe eine Frage.
Wie kann ich mit einer Batch datei per Tastendruck ein Programm öffnen.
Taste: 1
Pfad (Wo die Batch datei ist): C:\Users\danny\Desktop\HACK\hack.bat
Pfad (Was er öffnen soll): C:\Users\danny\Desktop\HACK\data\options.cmd
2 Antworten
@echo off
chcp 65001 >nul & rem Umlaute anzeigen..
echo Menü
echo E[x]it [O]ptions
echo [A]nderes Programm [N]och was Anderes
:loop
choice /c XOAN >nul
if %errorlevel% equ 1 exit /b
if %errorlevel% equ 2 start "" cmd /c "C:\Users\danny\Desktop\HACK\data\options.cmd"
if %errorlevel% equ 3 start "" "c:\blubb\anderes.exe"
if %errorlevel% equ 4 start "" "c:\grummel\Nochwasanderes.exe"
goto loop
Glossar:
...Anmerkung am Rande.. Ich finde es immer Amüsant, wenn Anfänger mit dem Wort "Hack" agieren und nicht mal über trivialstes Basiswissen verfügen😏
Nein.
Ich wollte ein Fake Hack für Fortnite für mein Kumpel machen weil er die ganze zeit ein Fortnite Hack sucht. Und da wollte ich ihn Pranken.
Mit ner Batch? Mh ich glaub das wird ein lahmer Scherz, bei dem er auch noch mithelfen muss.
Larm kann sein. Aber mein Freund ist in Technik bzw Computer noch Dümmer als ich. Und ich hab ein .vba mit dem Code:
:A
msgbox"Error404",0,"Microsoft Windows"
msgbox"Error404",0,"Microsoft Windows"
msgbox"Error404",0,"Microsoft Windows"
goto :A
Und wie willst du ihn dazu bringen, eine entsprechende Taste zu drücken?
Ich meine die Taste, mit der er den Aufruf des VBA Scripts starten soll.
trotzdem Lame 🥱😴
schau mal die Rubrik batch-trick durch, neben recht nützlichen Sachen finden sich auch ein paar Scherze.
Hier eine Vorlage für eine Bildschirmfüllende Anzeige :
fakeBSOD.cmd
<!-- : Begin batch
@echo off
set "selfHta=%~0"
start "" mshta.exe "%selfHta%"
exit /b
::exit /b prevent's the Batch from parsing the leftover of the batchfile echo
::after the next line begins the HTML/HTA itself
-->
<!DOCTYPE html>
<meta http-equiv="x-ua-compatible" content="ie=9">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>HTA_PictureView</title>
<hta:application
ID="oHTA"
applicationname="HTA_PictureView"
border="none"
borderstyle="none"
caption="no"
contextmenu="no"
icon="no"
innerborder="no"
maximizebutton="no"
minimizebutton="no"
navigable="no"
scroll="no"
scrollflat="no"
selection="no"
showintaskbar="yes"
singleinstance="no"
sysmenu="no"
version="1.0"
windowState="maximize">
<html>
<body onload="Window_onLoad()" >
<!--//hidden Button at top left Corner , a little darker as the picture-->
<div style="background-color:rgba(0, 0, 0,0.05); width:30px; height:30px" id="aus" onclick="window.close()"></div>
<div id="debug"></div>
<div id="TextContainer">
<div id="smile">
<h1>:(</h1>
</div>
<h2> Fataler Fehler </h2>
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>
<p></p>
<p>Ihr PC benötigt einen dringenden Ölwechsel!</p>
<p>rufen sie die Nummer 0815 4712 an! </p>
</div>
</body>
<html>
<style>
html
{
height: 100%;
}
body
{
height: 100%;
margin: 0;
background-color: #5050ff;
}
h1
{
margin: 0;
font-size: 16vh;
}
h2
{
font-size: 8vh;
}
p
{
font-size: 4vh;
}
#smile
{
width: 10%;
margin-left: 0px;
margin-top: 0px;
margin-right: 5%;
margin-bottom:1%;
float: left
}
#TextContainer
{
margin: 10%;
margin-left: 20%;
color: White;
}
</style>
<script>
var count=0;
var SmileAni=[':(' ,':|', ':)' , ';)' , ':)' ,':|' ];
function Window_onLoad()
{
myInterval = setInterval(animateSmilie, 8000);
HideCursor(1000);
};
// =========== Helper Funktions =============
function animateSmilie()
{
var index= ++count % SmileAni.length;
document.getElementById("smile").innerHTML='<h1>' + SmileAni[index] + '</h1>';
//document.getElementById("debug").innerHTML= 'count= '+count + ', SmileAni.lenght= '+SmileAni.length +'index='+ index;
}
function HideCursor(idleTime)
{
var mouseTimer = null, cursorVisible = true;
function disappearCursor()
{
mouseTimer = null;
document.body.style.cursor = 'none';
cursorVisible = false;
}
document.onmousemove = function()
{
if (mouseTimer)
{ window.clearTimeout(mouseTimer);}
if (!cursorVisible)
{
document.body.style.cursor = 'default';
cursorVisible = true;
}
mouseTimer = window.setTimeout(disappearCursor, idleTime);
} };
</script>
statt des Bluscreens kannst Du fast alles einbauen, was Html IE=9 uund Batch hergibt...
Das Stelle ich ja ein. Also die Taste für den Start (S), startet ja den VBA Script, also nicht der "HACK" sondern den VBA script
Schon, aber warum sollte er die Taste "S" drücken, wenn die Batch aktiv ist?
Wenn er sich gerade in einem Spiel befindet, wird das nichts, denn der Eingabefokus liegt dann nicht auf dem Kommandozeileninterpreter.
Erstmals danke.
Aber ich wollte ein Fake Hack für Fortnite für mein Kumpel machen weil er die ganze zeit ein Fortnite Hack sucht. Und da wollte ich ihn Pranken.
Mit dem Befehl "Choice".
Bitte wie?!
Kannst du mir nicht das Script für die Batch datei schicken?!
choice /c /n "ab" /m "(a)Auswahl 1, (b)Auswahl 2"
if errorlevel 1 goto auswahl1
if errorlevel 2 goto auswahl2
Das ist für den Tastendruck. Was du unter die Marken "auswahl1" und "auswahl2" am Ende drunter schreibst, ist deine Sache.
Vielleicht gehts um ein Rezept für Rinderhack?