Jump to content


Photo

Silent Dos


  • This topic is locked This topic is locked
58 replies to this topic

#1 TGMG

TGMG

    G-java creator

  • New Member
  • 706 posts
  • Version:GM8

Posted 30 December 2005 - 02:40 PM

Silent dos
This will run dos commands like 'rename' or command line programs without opening up the commande line window :).

I was looking for a way to do this and I couldn't find a dll on this forums so I made my own.

Unlike execute_shell(prog,arg) this does not need a bat file (and it doesn't open the command line window ;))

Download:
http://forums.g-java...p;showentry=113
  • 0

#2 tsg1zzn

tsg1zzn

    GMC Member

  • New Member
  • 1163 posts
  • Version:Unknown

Posted 30 December 2005 - 02:55 PM

I was looking for a way to do this and I couldn't find a dll on this forums so I made my own.

<{POST_SNAPBACK}>

Bet you didn't see the pinned topic with Dll Download Links for Game Maker, yes? There should be about three there already.
  • 0

#3 TGMG

TGMG

    G-java creator

  • New Member
  • 706 posts
  • Version:GM8

Posted 30 December 2005 - 04:15 PM

Actually I tried all of them none of them managed to do what I wanted.
  • 0

#4 GdaTerry

GdaTerry

    Ultimate-lifeform

  • GMC Member
  • 367 posts
  • Version:Unknown

Posted 30 December 2005 - 05:08 PM

Wow this will be very useful for one of my programs. :)

Nice job!
  • 0

#5 takua108

takua108

    GMC Member

  • GMC Member
  • 582 posts

Posted 30 December 2005 - 05:53 PM

Yeah I'll definately use this in the next version of GMupdate, 'cause it runs XCOPY to copy files sometimes. Thanks!
  • 0

#6 TGMG

TGMG

    G-java creator

  • New Member
  • 706 posts
  • Version:GM8

Posted 31 December 2005 - 12:20 AM

Great :). I am very glad to hear that some people have uses for my first dll ;)
  • 0

#7 benoit.rouleau

benoit.rouleau

    GMC Member

  • GMC Member
  • 1576 posts
  • Version:GM:Studio

Posted 14 February 2006 - 11:17 PM

Oh, I thought it could run a DOS application in background. I would have needed this for BMG, but I dont think it could work with commands.

Edited by benetonmovie, 14 February 2006 - 11:19 PM.

  • 0

#8 MS-DOS

MS-DOS

    Bad command or filename

  • New Member
  • 428 posts

Posted 14 February 2006 - 11:19 PM

WOOT!! DOS!!!!!!!! YAY!!!!! :DDDDDDDD
  • 0

#9 TGMG

TGMG

    G-java creator

  • New Member
  • 706 posts
  • Version:GM8

Posted 14 February 2006 - 11:41 PM

It does run dos apps in the background ::lmao:: Also commands work.
  • 0

#10 advertigo

advertigo

    GMC Member

  • New Member
  • 112 posts

Posted 15 February 2006 - 12:04 AM

pretty cool, havent tried it yet but this'll help me with cryptor dll that when it decrypts a file it makes it in a read only attribute...
  • 0

#11 benoit.rouleau

benoit.rouleau

    GMC Member

  • GMC Member
  • 1576 posts
  • Version:GM:Studio

Posted 16 February 2006 - 12:49 AM

Oh ok, but it cannot wait until the application is done to continue like execute_program... ^_^

EDIT: Oh one other question, can we put arguments to the application? execute_program can.

Edited by benetonmovie, 16 February 2006 - 01:39 AM.

  • 0

#12 TGMG

TGMG

    G-java creator

  • New Member
  • 706 posts
  • Version:GM8

Posted 16 February 2006 - 01:47 AM

Hmm I will look into the waiting part ^_^

Also yes you can put in as many arguments as you want. This is how GMMagick works. So if you want an example look at the gm magick source.
  • 0

#13 benoit.rouleau

benoit.rouleau

    GMC Member

  • GMC Member
  • 1576 posts
  • Version:GM:Studio

Posted 16 February 2006 - 02:29 AM

Well I tried something and I think it waits automatically... or its really fast.
  • 0

#14 TGMG

TGMG

    G-java creator

  • New Member
  • 706 posts
  • Version:GM8

Posted 16 February 2006 - 12:46 PM

Yes it does wait for the application/command to finish ^_^
  • 0

#15 Cynical

Cynical

    Inside the Cynic

  • New Member
  • 423 posts

Posted 16 February 2006 - 09:34 PM

Can it return to the GM program what the DOS command window outputs (ex. errors, etc.)? If so, you could make a full blown POP mail client with a DLL like this...
  • 0

#16 benoit.rouleau

benoit.rouleau

    GMC Member

  • GMC Member
  • 1576 posts
  • Version:GM:Studio

Posted 17 February 2006 - 12:39 AM

Ok thanks! How do I give credits? :skull:

Edited by benetonmovie, 17 February 2006 - 12:40 AM.

  • 0

#17 Smarttart62

Smarttart62

    designFUSIONô

  • New Member
  • 2619 posts

Posted 17 February 2006 - 02:14 AM

@Cynical
DOS has a log mode, which is what i used in my FTP thing that i released some time ago...

You can always just wait for the log file to appear :skull:
-Steve
  • 0

#18 benoit.rouleau

benoit.rouleau

    GMC Member

  • GMC Member
  • 1576 posts
  • Version:GM:Studio

Posted 19 March 2006 - 05:37 PM

I've got some problems with the DLL... Sometimes it doesnt run the application correctly. I won't use it anymore. Thanks anyway...
  • 0

#19 TGMG

TGMG

    G-java creator

  • New Member
  • 706 posts
  • Version:GM8

Posted 19 March 2006 - 06:04 PM

Can you tell me what happens? It always works fine for me. Were you trying to run a program with a gui or something?

@Smarttart62 - where is the log file placed?

Edited by Thegamemakerguru, 19 March 2006 - 06:04 PM.

  • 0

#20 tuntis

tuntis

    GMC Member

  • New Member
  • 1839 posts

Posted 19 March 2006 - 06:16 PM

WOOT!! DOS!!!!!!!! YAY!!!!! :DDDDDDDD

<{POST_SNAPBACK}>

Are you trying to sound "professional" by repeating the word DOS all over and spamming topics what contain the word "DOS" with messages such as the one quoted?
  • 0

#21 takua108

takua108

    GMC Member

  • GMC Member
  • 582 posts

Posted 19 March 2006 - 06:18 PM

Does it matter? More importantly, could that have been PM'd to him instead of publically taking issue with it? Especially when it's not really on-topic?
  • 0

#22 Smarttart62

Smarttart62

    designFUSIONô

  • New Member
  • 2619 posts

Posted 19 March 2006 - 08:22 PM

To log a DOS command just add this line:
> "path\to\log\file"

For example, in my FTP thingy i did this:
ftp -s:"path\to\save\bat" > "path\to\log\file"

-Steve
  • 0

#23 wormhole

wormhole

    GFX Redefined

  • New Member
  • 311 posts

Posted 19 March 2006 - 08:43 PM

I quite llike this but may I suggest a wait option?
  • 0

#24 TGMG

TGMG

    G-java creator

  • New Member
  • 706 posts
  • Version:GM8

Posted 19 March 2006 - 09:00 PM

@Smarttart62 - Thank you very much :D

@wormhole - It always waits for the command to finish.
  • 0

#25 TGMG

TGMG

    G-java creator

  • New Member
  • 706 posts
  • Version:GM8

Posted 25 March 2006 - 05:22 PM

The link is now fixed :)
  • 0

#26 wormhole

wormhole

    GFX Redefined

  • New Member
  • 311 posts

Posted 25 March 2006 - 07:18 PM

Sry I meant like if you can chose to wait or not.

:)
  • 0

#27 TGMG

TGMG

    G-java creator

  • New Member
  • 706 posts
  • Version:GM8

Posted 25 March 2006 - 07:20 PM

Sorry but the way I have written this dll that will not be possible, sorry :)
  • 0

#28 wormhole

wormhole

    GFX Redefined

  • New Member
  • 311 posts

Posted 25 March 2006 - 07:24 PM

:)
Oh well, I'll have to live without it...
Actually I had a dll called simply "run.dll" where you could choose if it ran in the background and if it should wait... But I seem to have misplaced it...
  • 0

#29 gameduck

gameduck

    GMC Member

  • New Member
  • 166 posts

Posted 26 March 2006 - 09:23 AM

actually, it isn't DOS, it is just an emulator of it, it only supports a few dos commands, DOS is a different thing....
  • 0

#30 Daniel-Dane

Daniel-Dane

    GMC Member

  • New Member
  • 3581 posts

Posted 26 March 2006 - 12:51 PM

Do(e)s it matter ?
  • 0

#31 stump_corey

stump_corey

    GMC Member

  • New Member
  • 303 posts

Posted 21 April 2006 - 09:59 PM

sweet shutdown
use a if statement during step
if it is on that hour it will shutdown my comp sweet
  • 0

#32 Chirantha

Chirantha

    GMC Member

  • New Member
  • 502 posts

Posted 22 April 2006 - 08:19 PM

Please Try to make the function return the result of the executed command. It will be very useful :(
  • 0

#33 TGMG

TGMG

    G-java creator

  • New Member
  • 706 posts
  • Version:GM8

Posted 02 March 2007 - 02:06 PM

@Chirantha - You could write the result to a file from dos and read into gm.
  • 0

#34 benoit.rouleau

benoit.rouleau

    GMC Member

  • GMC Member
  • 1576 posts
  • Version:GM:Studio

Posted 04 March 2007 - 02:24 AM

Hello TGMG,

Sorry to use this topic to contact you, but I can't send you a PM. It looks like your inbox is full... and I would really like to talk to you. Do you have an email address? Thanks!

Benoit
  • 0

#35 TGMG

TGMG

    G-java creator

  • New Member
  • 706 posts
  • Version:GM8

Posted 04 March 2007 - 04:38 AM

thegamemakerguru@gmail.com
or get my msn by clicking on my name :D
  • 0

#36 novaz

novaz

    GMC Member

  • GMC Member
  • 592 posts
  • Version:Unknown

Posted 08 March 2007 - 12:20 AM

very good work, i use the dll in a comic viewer with subtitles :P
  • 0

#37 sinkhead101

sinkhead101

    sinkhead.net

  • New Member
  • 483 posts

Posted 18 March 2007 - 09:49 AM

How would I use this DLL to get a directory listing of a folder outputted to a log file?
I understand the DOS command for listing the contents of a folder is 'dir', and the folder I want to list the contents of is held inside the variable 'option'.
I tried this but it errors, saying it expects a ( or ,
global.sdoslist = external_call(global.sdos, "dir", string(option+)"> "longresult.html"");

Can anybody help me?
- Sam
  • 0

#38 CHFD_113

CHFD_113

    GMC Member

  • GMC Member
  • 187 posts
  • Version:Unknown

Posted 19 March 2007 - 11:27 PM

Um, why is it an .EXE file instead of .ZIP or .GM6 with DLL?
  • 0

#39 FlipSide

FlipSide

    GMC Member

  • New Member
  • 281 posts

Posted 22 March 2007 - 10:20 PM

I am using this to get my dynamic IP from a host name at DynDNS.org using NSLOOKUP (XP) so my Online Game will find the proper server IP.

Works, but I will eventually use the 39DLL to do this.

This was quick and simple.

Thanks


If anyone is interested and using a service like DynDNS.org, here is my code using the silent_dos DLL to retrieve the dynamic IP address from the hostname:

silent_dos();
global.bbb = external_call(global.nnn,"nslookup"," turbe.game-host.org > servers.txt");

if file_exists("servers.txt")
    {
    servers=file_text_open_read("servers.txt");
    file_text_readln(servers);
    file_text_readln(servers);
    file_text_readln(servers);
    file_text_readln(servers);
    line_ip=file_text_read_string(servers);
    file_text_close(servers);
    lgth=string_length(line_ip);
    global.serverip=string_copy(line_ip,11,lgth);
    file_delete("servers.txt");
    //show_message(global.serverip);
    }
    else
    {
    show_message("Unable to Resolve Server IP.");
    game_end();
    exit;
    }
    
if global.serverip=""
    {
    show_message("Unable to Resolve Server IP.");
    game_end();
    exit;
    }

If there are no DNS errors, global.serverip will equal the dynamic IP address from the Hostname hosted at DynDNS.org.

Edited by Turbe, 22 March 2007 - 11:28 PM.

  • 0

#40 uuf6429

uuf6429

    Covac Software

  • New Member
  • 2522 posts

Posted 24 May 2007 - 07:27 AM

Link's broken, any other possible location? I really need this.
Edit: found it. I wonder why it is a .exe...
Hmm a self extractor, in the future you should avoid them, people including me might not like this.

Edited by uuf6429, 24 May 2007 - 07:33 AM.

  • 0

#41 TGMG

TGMG

    G-java creator

  • New Member
  • 706 posts
  • Version:GM8

Posted 24 May 2007 - 11:26 AM

I can't remember why I made it a self extractor, I had a reason at the time :s
  • 0

#42 superjoebob

superjoebob

    YM2612

  • New Member
  • 1515 posts

Posted 07 June 2007 - 04:11 AM

Couldnt this be used to create malicious programs? I happen to know that if you tamper with the himem.sys file (im not saying how...) you can screw up your OS pretty badly... Seems pretty useful though if its not abused!
  • 0

Game Maker user since the beginning
Online Music Portfolio - High-Res Wallpaper
I speak before I think.
Posted Image

Posted ImagePosted Image


#43 uuf6429

uuf6429

    Covac Software

  • New Member
  • 2522 posts

Posted 07 June 2007 - 07:50 AM

@ superjoebob - Did you know using gm's exteneded registry settings you could badly screw up your os?

@ TGMG - SDos is perfect for retrieving PHP return data (I'm working on a free and full php editor).

Edited by uuf6429, 07 June 2007 - 07:52 AM.

  • 0

#44 superjoebob

superjoebob

    YM2612

  • New Member
  • 1515 posts

Posted 08 June 2007 - 07:36 PM

superjoebob - Did you know using gm's exteneded registry settings you could badly screw up your os?



what does that have to do with the dos prompt?
  • 0

Game Maker user since the beginning
Online Music Portfolio - High-Res Wallpaper
I speak before I think.
Posted Image

Posted ImagePosted Image


#45 uuf6429

uuf6429

    Covac Software

  • New Member
  • 2522 posts

Posted 10 June 2007 - 03:16 PM

Well you said the dll is dangerous and i said GM is dangerous :(
  • 0

#46 TGMG

TGMG

    G-java creator

  • New Member
  • 706 posts
  • Version:GM8

Posted 02 July 2007 - 12:55 PM

new link:
http://forums.g-java...1&showentry=113
  • 0

#47 CHFD_113

CHFD_113

    GMC Member

  • GMC Member
  • 187 posts
  • Version:Unknown

Posted 02 July 2007 - 02:07 PM

You guys complain too much...
Yes, it may be dangerous, but honestly... Anything you abuse is dangerous am I not right? If you loop a file_copy, isn't that malicious, if you file_delete() tons of system files, isn't that malicious... If a program displays popup ads, isn't that malicious? Anything you abuse can be considered dangerous or malicious. It's up to the good heart of the creators to do what's right. There's no need to go around making harmful programs out of GM, especially since the filesize is over a meg! Silly script kiddies, use C++, Java, VBS or somethign besides GM.

That is all ;)

Can you PLEASE make this a zipped DLL and GM6 example? I don't really want to download an exe. I've got too many things to worry about ;) Ideal with viruses all day and who knows what's gonna happen next xD
Thanks!

Oh btw, nice dll
I'm using it in several of my programs now.
PS: This DLL opens a new realm of possibilities! You can use several commands in sequences to get the results of other DLLs without having to use a DLL for it.

Edited by CHFD_113, 02 July 2007 - 02:09 PM.

  • 0

#48 superjoebob

superjoebob

    YM2612

  • New Member
  • 1515 posts

Posted 23 July 2007 - 11:47 PM

Ive been looking for a way to build a mame front end for my arcade machine, and this did the trick perfectly! Exactly what i needed, thanks a bunch!

By the way, i take back every bad thing i said about this! :(

Edited by superjoebob, 23 July 2007 - 11:49 PM.

  • 0

Game Maker user since the beginning
Online Music Portfolio - High-Res Wallpaper
I speak before I think.
Posted Image

Posted ImagePosted Image


#49 TGMG

TGMG

    G-java creator

  • New Member
  • 706 posts
  • Version:GM8

Posted 25 July 2007 - 04:34 PM

thanks :D

I have now uploaded a zip file for those who don't want to download exe.
  • 0

#50 freaky_entertainment

freaky_entertainment

    GMC Member

  • GMC Member
  • 451 posts

Posted 23 September 2007 - 01:04 AM

How do I get what the command I type returns ? :medieval:
  • 0

Cxn8eVf.png gVywn2c.png





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users