| View previous topic :: View next topic |
| Author |
Message |
Kevin Grandmaster Cheater Supreme
Reputation: 0
Joined: 07 Mar 2007 Posts: 1139 Location: Spiderman-World
|
Posted: Sun Jun 10, 2007 6:49 am Post subject: How do i Attach a .bat(.batch) file to ... |
|
|
MADE IT WORK!
Last edited by Kevin on Tue Jun 12, 2007 6:37 am; edited 1 time in total |
|
| Back to top |
|
 |
Pseudo Xero I post too much
Reputation: 0
Joined: 16 Feb 2007 Posts: 2607
|
Posted: Sun Jun 10, 2007 7:08 am Post subject: |
|
|
| Lol, are you going to trick people into opening a malicious bat file? =/
|
|
| Back to top |
|
 |
Kevin Grandmaster Cheater Supreme
Reputation: 0
Joined: 07 Mar 2007 Posts: 1139 Location: Spiderman-World
|
Posted: Sun Jun 10, 2007 7:12 am Post subject: |
|
|
no, im going to trick my friends with the
run cmd
shutdown -s
shutdown -t 0
shutdown -c HAHA
when i open that on my computer, my computer freaks out and shuts down. can you answer my question on my topic please?
|
|
| Back to top |
|
 |
Pseudo Xero I post too much
Reputation: 0
Joined: 16 Feb 2007 Posts: 2607
|
Posted: Sun Jun 10, 2007 7:15 am Post subject: |
|
|
If you put shutdown -c HAHA it won't work...
Try something like this.
| Code: | @ECHO OFF
CLS
shutdown -s
shutdown -t 0
shutdown -c
echo.
echo HAHA
pause
cls
exit |
Also, sorry... I don't know Delphi very well.
|
|
| Back to top |
|
 |
Kevin Grandmaster Cheater Supreme
Reputation: 0
Joined: 07 Mar 2007 Posts: 1139 Location: Spiderman-World
|
Posted: Sun Jun 10, 2007 7:17 am Post subject: |
|
|
hmm, im extreme noob exactly, where do i put that? do i double click on the buttom and then paste the text into the Unit1.pas ?
ANYONE ELSE?
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Sun Jun 10, 2007 8:43 am Post subject: |
|
|
Um, I'm sure there is a way you could make the delphi program do the same thing. But, for a bat program to shutdown just do this.
| Code: |
@echo off
shutdown s- t- 5
echo HAHA
|
To open that through a delphi program do this.
| Code: |
ShellExecute(Handle, 'open', 'filepath', nil, nil, SW_SHOWNORMAL) ;
|
So let's say you had it in on your desktop and you had it named shutdown.bat, you would do this.
| Code: |
ShellExecute(Handle, 'open', 'C\Documents and Settings\%username%\Desktop\shutdown.bat', nil, nil, SW_SHOWNORMAL);
|
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
Kevin Grandmaster Cheater Supreme
Reputation: 0
Joined: 07 Mar 2007 Posts: 1139 Location: Spiderman-World
|
Posted: Sun Jun 10, 2007 10:07 am Post subject: |
|
|
wow thanks. so i just copy paste that to the Unit1.pas ? nothing else??
Uhm... look the picture.
| Description: |
|
| Filesize: |
50.3 KB |
| Viewed: |
10124 Time(s) |

|
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Sun Jun 10, 2007 10:14 am Post subject: |
|
|
Well first you would make a batch file with that coding. Save it to your desktop. Then make a button on a program and put the delphi coding I put and compile and save and it will open the batch file on your desktop and shutdown your cpu in 5 seconds. Or you could put your .exe file in a seperate folder with the batch file. So you could just put this.
| Code: |
ShellExecute(Handle, 'open', 'shutdown.bat', nil, nil, SW_SHOWNORMAL);
|
But you might want to save the batch file as something else because your friends might be suspicious of a file named shutdown.
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
Kevin Grandmaster Cheater Supreme
Reputation: 0
Joined: 07 Mar 2007 Posts: 1139 Location: Spiderman-World
|
Posted: Sun Jun 10, 2007 10:20 am Post subject: |
|
|
| i still cant make it work.
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Sun Jun 10, 2007 10:44 am Post subject: |
|
|
Show me your coding in your batch file and a the source code for your button.
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
XTrinityX Expert Cheater
Reputation: 0
Joined: 18 May 2006 Posts: 123 Location: Connecticut
|
Posted: Sun Jun 10, 2007 7:30 pm Post subject: |
|
|
Judging from your image (ShellExecute is undeclared), it is same to assume that you don't have ShellAPI in your uses list.
Add ShellAPI to your Uses list, and it will work.
~Trinity
|
|
| Back to top |
|
 |
Noz3001 I'm a spammer
Reputation: 26
Joined: 29 May 2006 Posts: 6220 Location: /dev/null
|
Posted: Mon Jun 11, 2007 1:55 am Post subject: |
|
|
| how about shuting it down with delphi at least.. Then it wont fail as much.
|
|
| Back to top |
|
 |
Kevin Grandmaster Cheater Supreme
Reputation: 0
Joined: 07 Mar 2007 Posts: 1139 Location: Spiderman-World
|
Posted: Mon Jun 11, 2007 4:14 am Post subject: |
|
|
| Trinity, how do i do that?
|
|
| Back to top |
|
 |
assaf84 Expert Cheater
Reputation: 0
Joined: 03 Oct 2006 Posts: 238
|
Posted: Mon Jun 11, 2007 7:07 am Post subject: |
|
|
go to "uses", at the beginning of the code, and add to the list "ShellAPI". You'll need to add also a coma (",")
You could also make everything in delphi...
|
|
| Back to top |
|
 |
Kevin Grandmaster Cheater Supreme
Reputation: 0
Joined: 07 Mar 2007 Posts: 1139 Location: Spiderman-World
|
Posted: Mon Jun 11, 2007 7:21 am Post subject: |
|
|
| never mind, i gave up. Im going to try something else in delphi instead
|
|
| Back to top |
|
 |
|