View Poll Results: Does DOS still have a place in todays Programming World?

Voters
24. You may not vote on this poll
  • Yes

    18 75.00%
  • No

    6 25.00%
Page 1 of 2 12 LastLast
Results 1 to 40 of 41

Thread: Harnessing the Power of DOS

  1. #1

    Thread Starter
    Hyperactive Member kazar's Avatar
    Join Date
    Apr 2006
    Location
    UK
    Posts
    323

    Harnessing the Power of DOS

    It's a fact - APIs have replaced many of the DOS Functions, and yet there are still people who consider dos a powerful tool, after all .net provides the ability to make console applications.

    So, i created a simple way, without messing around with console opening and manipulation, of sending and recieving the results of DOS commands in VB6.

    Sending a DOS Command:

    Now for most vb programmers, sending a command to DOS is easy as pie. However, if you want to receive a command from DOS, you need to wait for the command to finish executing, right? So i use this code to send a command to DOS and wait for it to finish. Some of it can be found on MSDN btw.

    VB Code:
    1. Option Explicit
    2. Private Type STARTUPINFO
    3.       cb As Long
    4.       lpReserved As String
    5.       lpDesktop As String
    6.       lpTitle As String
    7.       dwX As Long
    8.       dwY As Long
    9.       dwXSize As Long
    10.       dwYSize As Long
    11.       dwXCountChars As Long
    12.       dwYCountChars As Long
    13.       dwFillAttribute As Long
    14.       dwFlags As Long
    15.       wShowWindow As Integer
    16.       cbReserved2 As Integer
    17.       lpReserved2 As Long
    18.       hStdInput As Long
    19.       hStdOutput As Long
    20.       hStdError As Long
    21.    End Type
    22. Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    23.    Private Type PROCESS_INFORMATION
    24.       hProcess As Long
    25.       hThread As Long
    26.       dwProcessID As Long
    27.       dwThreadID As Long
    28.    End Type
    29. Private Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
    30.    Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal _
    31.       hHandle As Long, ByVal dwMilliseconds As Long) As Long
    32.  
    33.    Private Declare Function CreateProcessA Lib "kernel32" (ByVal _
    34.       lpApplicationName As String, ByVal lpCommandLine As String, ByVal _
    35.       lpProcessAttributes As Long, ByVal lpThreadAttributes As Long, _
    36.       ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, _
    37.       ByVal lpEnvironment As Long, ByVal lpCurrentDirectory As String, _
    38.       lpStartupInfo As STARTUPINFO, lpProcessInformation As _
    39.       PROCESS_INFORMATION) As Long
    40.  
    41.    Private Declare Function CloseHandle Lib "kernel32" _
    42.       (ByVal hObject As Long) As Long
    43.  
    44.    Private Declare Function GetExitCodeProcess Lib "kernel32" _
    45.       (ByVal hProcess As Long, lpExitCode As Long) As Long
    46.  
    47.    Private Const NORMAL_PRIORITY_CLASS = &H20&
    48.    Private Const INFINITE = -1&
    49.  
    50.    Public Function ExecCmd(cmdline$)
    51.       Dim proc As PROCESS_INFORMATION
    52.       Dim start As STARTUPINFO
    53.  
    54.       ' Initialize the STARTUPINFO structure:
    55.       start.cb = Len(start)
    56.  
    57.       ' Start the shelled application:
    58.       ret& = CreateProcessA(vbNullString, cmdline$, 0&, 0&, 1&, _
    59.          NORMAL_PRIORITY_CLASS, 0&, vbNullString, start, proc)
    60.        DoEvents
    61.         Dim sysbuffer As String
    62.         Dim sysbuffersize As Long
    63.          GetSystemDirectory sysbuffer, sysbuffersize
    64.  
    65.       ' Wait for the shelled application to finish:
    66.          ret& = WaitForSingleObject(proc.hProcess, INFINITE)
    67.          Call GetExitCodeProcess(proc.hProcess, ret&)
    68.          Call CloseHandle(proc.hThread)
    69.          Call CloseHandle(proc.hProcess)
    70.          ExecCmd = ret&
    71.  
    72.    End Function
    73.  
    74. Function SendDOSCommand(command as string, destlog as string)
    75.  
    76. 'i know that using bat files is a strange way to do it, but i find it works better
    77.  
    78.      Open "C:\Dosemu.bat" for output as #1
    79.               Print #1, command + " > " + destlog
    80.  
    81. 'the  > destlog part is the key to the whole thing, since it forces dos to copy it's results to the specifyed file
    82.  
    83.      Close
    84.  
    85.  
    86.  ExecCmd ("C:\dosemu.bat")
    87. 'this line waits for the command to finish executing
    88. Kill ("C:\dosemu.bat")
    89. 'and this gets rid of the temp bat file
    90.  
    91. End Function


    So thats that for sending commands, now for retrieving them. In the code above, the dos results have been saved to a file, called destlog.

    To get them back is simple. Just Read the File! Create a textbox and call it dosbox, with multiline enabled.

    VB Code:
    1. Sub getdosresults(doslog as string)
    2.  
    3. Open doslog For Input As #1
    4.     On Error GoTo skipfile
    5.         Do
    6.         Input #1, buffer
    7.         dosbox.Text = dosbox.Text + buffer + vbCrLf
    8.      'this line gets each line from the file and adds a next line character
    9.         Loop
    10.        
    11. skipfile:
    12. Close
    13.  
    14. End Sub
    KAZAR

    The Law Of Programming:

    As the Number of Lines of code increases, the number of bugs generated by fixing a bug increases exponentially.
    __________________________________
    www.startingqbasic.co.uk

  2. #2
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Harnessing the Power of DOS

    Being able to create command line .BAT files to do things like FTP files and copy/rename/post-process them is a requirement of today's programming world.

    Being able to schedule these jobs to run at certains times, unattended, is also a part of today's programming world...

    With that said, DOS command line seems to have a place.

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  3. #3

    Thread Starter
    Hyperactive Member kazar's Avatar
    Join Date
    Apr 2006
    Location
    UK
    Posts
    323

    Re: Harnessing the Power of DOS

    You know that, I know that, but i have met a worrying amount of people who think otherwise, i'm afraid.
    KAZAR

    The Law Of Programming:

    As the Number of Lines of code increases, the number of bugs generated by fixing a bug increases exponentially.
    __________________________________
    www.startingqbasic.co.uk

  4. #4
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    Re: Harnessing the Power of DOS

    Let them think that way.
    If you know DOS very well, you'll be always one step ahed.

    There are some things that aren't possible from windows (atleast not easily), but they are just a child's play in DOS.
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  5. #5

    Thread Starter
    Hyperactive Member kazar's Avatar
    Join Date
    Apr 2006
    Location
    UK
    Posts
    323

    Re: Harnessing the Power of DOS

    Very true, personally, i always found the tracert command really useful, along with ipconfig, and netstat.

    Any favourite commands?
    KAZAR

    The Law Of Programming:

    As the Number of Lines of code increases, the number of bugs generated by fixing a bug increases exponentially.
    __________________________________
    www.startingqbasic.co.uk

  6. #6
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    Re: Harnessing the Power of DOS

    ***tree C:\*.* /y
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  7. #7

    Thread Starter
    Hyperactive Member kazar's Avatar
    Join Date
    Apr 2006
    Location
    UK
    Posts
    323

    Re: Harnessing the Power of DOS

    Perhaps there should be a batch section on the forum...?
    KAZAR

    The Law Of Programming:

    As the Number of Lines of code increases, the number of bugs generated by fixing a bug increases exponentially.
    __________________________________
    www.startingqbasic.co.uk

  8. #8
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Harnessing the Power of DOS

    There arent enough questions asked to justify a separate forum... we have other forums where they can be asked (and have been answered).

  9. #9
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Harnessing the Power of DOS

    Checkout Joacim Anderssons FAQ thread on redirecting the DOS command window information.

    http://www.vbforums.com/showthread.php?t=364219

    There is always a need for DOS in programming, its just knowing when and where to apply it. This is what sets a good programmer above other programmers.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  10. #10

  11. #11
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Harnessing the Power of DOS

    On the question if DOS have a place in todays programming world, I had to answer No! DOS is dead and has been so for many years now. What you guys are talking about, and what the question should be is if there is a place for console based application in todays programming world, and on that question I would have said Yes of course it has!

    On my WinXP computer I don't have DOS. The console window is not DOS. All "DOS commands" are Win32 console commands. The Windows console is also much more powerful than DOS ever was. The command line limit is about 8KB instead of 260 character. You can combine several commands on the same line by using the & character, for example:
    Code:
    cd \ & dir
    It has *true* support for long filenames. A Win32 console application has access to the Win API even though there is no use for any of the GDI functions. Console applications, like all other Win32 applications, runs in there own virtual memory space and as such have 2GB of memory to play with (compared to 640 for a DOS app)... the list goes on...

    So don't confuse DOS with the Windows console because they are not the same thing even though the name of many commands are the same.

  12. #12

  13. #13
    Lively Member
    Join Date
    Oct 2005
    Posts
    127

    Re: Harnessing the Power of DOS

    Personally - I miss 'edlin'...

  14. #14
    Hyperactive Member Datacide's Avatar
    Join Date
    Jun 2005
    Posts
    309

    Re: Harnessing the Power of DOS

    DOS, the ultimate hacking tool...

    I'll never give up my DOS knowledge and hope they continue to support it. It's so easy to create a .BAT file and gain access to things your
    not supposed too
    PHP in your FACE!

  15. #15
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Harnessing the Power of DOS

    What is it that a BAT file can give you access to that you're not supposed to? Absolutly nothing... What can a batch file do that you can't do with the WSH? Nothing! How much more access do you have to the OS from the WSH compared to a batch file? A whole lot. And it's still not DOS unless you're running a 10 year old version of Windows.

  16. #16
    Hyperactive Member Datacide's Avatar
    Join Date
    Jun 2005
    Posts
    309

    Re: Harnessing the Power of DOS

    Well when your at place where it's secured up and stuff and everythings removed from the start menu (like at the library). I just make a batch file in notepad and gain access to DOS.
    PHP in your FACE!

  17. #17
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Harnessing the Power of DOS

    If it's secure you will not be able to save and run a BAT file (if you could you could just as well create a script file and use WSH instead) and can everyone please stop calling the Windows command line for DOS

  18. #18
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Harnessing the Power of DOS

    What is WSH?

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  19. #19

  20. #20
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Harnessing the Power of DOS

    So it's just another way to execute a .BAT file?

    How do you get to WSH?

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  21. #21

  22. #22

  23. #23
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Harnessing the Power of DOS

    Quote Originally Posted by Joacim Andersson
    ... and can everyone please stop calling the Windows command line for DOS
    Joacim,
    I do share your sentiments but you need not to scream - lots of people (and small businesses) are still running off Win 95 (and even Win 3.1) platform so they do have a DOS despite the fact that it's (DOS that is) dead.
    Although it is 2006 and Windows Vista in on the way those win95 users are pretty happy campers so we must respect as well.
    Having said that I gues DOS isn't quite dead yet. Also, majority of "old-timers" refer to "command-line" as "DOS" and that's the end of it.

    Best regards.

  24. #24
    Fanatic Member
    Join Date
    Oct 2004
    Posts
    751

    Re: Harnessing the Power of DOS

    Quote Originally Posted by Joacim Andersson
    On the question if DOS have a place in todays programming world, I had to answer No! DOS is dead and has been so for many years now. What you guys are talking about, and what the question should be is if there is a place for console based application in todays programming world, and on that question I would have said Yes of course it has!

    On my WinXP computer I don't have DOS. The console window is not DOS. All "DOS commands" are Win32 console commands. The Windows console is also much more powerful than DOS ever was. The command line limit is about 8KB instead of 260 character. You can combine several commands on the same line by using the & character, for example:
    Code:
    cd \ & dir
    It has *true* support for long filenames. A Win32 console application has access to the Win API even though there is no use for any of the GDI functions. Console applications, like all other Win32 applications, runs in there own virtual memory space and as such have 2GB of memory to play with (compared to 640 for a DOS app)... the list goes on...

    So don't confuse DOS with the Windows console because they are not the same thing even though the name of many commands are the same.
    If DOS is truly dead they why does Microsoft still include command.com in Windows XP?
    So if command.com is DOS then you still have it on your computer silly pants.
    Don't even try and say command.com isn't DOS when the first lines that come up say:
    Microsoft<R> Windows DOS
    <C>Copyright Microsoft Corp 1990-2001
    (Btw, you do have DOS on your computer still, I'm running XP Pro.)
    I doubt DOS will ever go away (in fact DOS emulators will make sure of that, DOSBox being one of them). So many (great) legacy programs depend on DOS and old console commands, so I doubt Microsoft will ever get rid of it entirely.

    -rant rant-
    Thats my rant. Enjoy
    My Projects: [ Instant Messagener Client/Server ] [ VBPictochat ]

    My Sites:
    [ Datanethost ]
    [ Helpdesk ]

    Remember if my post was helpful then Rate This Post.

  25. #25
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Harnessing the Power of DOS

    I've got customers that create .BAT files for all kinds of purposes. Archiving files - moving backups from server to server...

    Running complex FTP operations - ones that require those ugly little "command-line" variables for date-stamping the filename...

    They can run these .BAT files from a desktop scheduler or even from the SQL Server Agent - they are rather general purpose.

    Are you all saying there is a better, newer, cleaner way to be doing this type of "operations" functionality?

    I'm not saying from VB - not from a coders perspective - but from the IT-staff at a shop - production type people.

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  26. #26
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Harnessing the Power of DOS

    Quote Originally Posted by szlamany
    ...Are you all saying there is a better, newer, cleaner way to be doing this type of "operations" functionality?...
    There are quite of few superb enterprize schedulers like Tivoli's Maestro (they probably have something new by now but what I knew as Maestro was extraordinary product).

  27. #27
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Harnessing the Power of DOS

    Quote Originally Posted by RhinoBull
    Joacim,
    I do share your sentiments but you need not to scream - lots of people (and small businesses) are still running off Win 95 (and even Win 3.1) [...]
    Having said that I gues DOS isn't quite dead yet. Also, majority of "old-timers" refer to "command-line" as "DOS" and that's the end of it.
    When did I scream? The fact that some companies might still run Windows 3.1 doesn't mean that DOS has a place in todays programming world, and that was the question that was asked.

    Also that DOS emulators exists doesn't mean squat either, Windows itself can emulate DOS pretty well too. But if you all say that DOS still have a place in todays programming world may I then ask when you last wrote a program for DOS? Writing a BAT file is not the same thing as writing a DOS program, you can run BAT files using Windows command line tool, which means that your running a Windows batch file and not a DOS program.

    That some people refers to the command line as DOS doesn't make it DOS, and this was my whole point, you should call things by their right names to avoid confusion.

    There's a huge difference between the Windows command line interpreter and DOS. Even when you run Command.com on WinXP it still uses Windows disk operations when you look at the file system, which means that you're not running DOS, you might call it a DOS command line emulator if you wish, but an emulator is not DOS.

    I might be able to dress up and disguise myself as Bill Gates, but that doesn't make me into Bill Gates does it? I just emulate him.

    I use BAT files as well sometimes, but (again) a BAT file is not (necessarily) the same as a DOS program, and running a BAT file on my WinXP computer doesn't mean that DOS suddenly gets installed and I then switch operating system.

  28. #28
    PowerPoster
    Join Date
    Aug 2005
    Location
    College Station, TX
    Posts
    4,521

    Re: Harnessing the Power of DOS

    Quote Originally Posted by k1ll3rdr4g0n
    If DOS is truly dead they why does Microsoft still include command.com in Windows XP?
    So if command.com is DOS then you still have it on your computer silly pants.

    (Btw, you do have DOS on your computer still, I'm running XP Pro.)
    No you dont "silly pants". What you see looks like DOS but it isnt. Its the command interpreter (cmd.exe), that was made to look similar for a reason (to make you think you are still working in DOS, when you actually aren't, which worked in your case )
    The command prompt is run from its own window by invoking the Windows XP command interpreter that is provided by the file cmd.exe located in the folder \Windows\System32\. (The old DOS command interpreter is command.com.) If you look in this folder you may also see several files that look suspiciously like some of the old DOS files. They are, however, different 32-bit versions with many new features.
    http://commandwindows.com/command1.htm
    Last edited by gigemboy; May 3rd, 2006 at 08:45 AM.

  29. #29
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    Re: Harnessing the Power of DOS

    Yes. WinMe/2K/XP/2003 doesn't have a 'true' DOS mode.
    That's why I always keep a Win98 partition.
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  30. #30
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Harnessing the Power of DOS

    Quote Originally Posted by Joacim Andersson
    When did I scream? The fact that some companies might still run Windows 3.1 doesn't mean that DOS has a place in todays programming world, and that was the question that was asked.

    Also that DOS emulators exists doesn't mean squat either, Windows itself can emulate DOS pretty well too. But if you all say that DOS still have a place in todays programming world may I then ask when you last wrote a program for DOS? Writing a BAT file is not the same thing as writing a DOS program, you can run BAT files using Windows command line tool, which means that your running a Windows batch file and not a DOS program.

    That some people refers to the command line as DOS doesn't make it DOS, and this was my whole point, you should call things by their right names to avoid confusion.

    There's a huge difference between the Windows command line interpreter and DOS. Even when you run Command.com on WinXP it still uses Windows disk operations when you look at the file system, which means that you're not running DOS, you might call it a DOS command line emulator if you wish, but an emulator is not DOS.

    I might be able to dress up and disguise myself as Bill Gates, but that doesn't make me into Bill Gates does it? I just emulate him.

    I use BAT files as well sometimes, but (again) a BAT file is not (necessarily) the same as a DOS program, and running a BAT file on my WinXP computer doesn't mean that DOS suddenly gets installed and I then switch operating system.
    That's so like Joacim: an article when few words could be enough...

  31. #31
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Harnessing the Power of DOS

    Quote Originally Posted by RhinoBull
    That's so like Joacim: an article when few words could be enough...
    If that was true there wouldn't be 30+ posts in this thread

    Besides it looks like everyone here thinks that DOS was equal to command.com which is wrong. Command.com was simply the command line interpreter of DOS, which was the user interface of DOS and not the operating system. You could easily replace command.com with another interpreter in the same way that you can replace the explorer.exe shell in Windows with another shell. Replacing the shell doesn't mean you're not running Windows though.

  32. #32
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Harnessing the Power of DOS

    This thread has really got some legs!

    But I'm still confused...

    Either the poll is poorly worded or the replies are simply all over the place.

    I thought the thread topic was related to creating a .BAT file to perform system operation tasks - file copies, FTP's - renames - run an .EXE - that type of stuff. That is what CMD (or COMMAND or DOS) means to me. It certainly doesn't bring to mind the old Win 3.1 where you booted to C:\ and were lucky if you had a PCShell-type GUI to work with...

    We do a lot of operational tasks with the SQL AGENT - but we always fall back on the agent running a "step" that is actually a .BAT file - since we can get so much more done without requiring a "programmers" mind. I come from a mainframe world (VAX/VMS) where creating BATCH COMMAND file scripts is a large part of your world.

    My customers could always ask me to write a "down-and-dirty" VB program to perform a file copy or SHELL and FTP or whatever - but that's not cost effective.

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  33. #33
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Harnessing the Power of DOS

    I agree that the poll is badly named, and this was my point in the first place. It doesn't really have anything to do with the ShellAndWait code that was posted. Batch files are however an essential tool but before MS released WSH you could only use the old DOS-style BAT files for this purpose or get a third party tool. Today writing a simple VBScript file (or JScript or any other script language supported by the WSH) is a better choice. A BAT file is great if you want to copy a few files or run a command line tool of some sort (like FTP.EXE) but what if you need your batch job to update the Registry or send an e-mail when a certain condition is met? Or maybe you need to run some overnight printing job...

  34. #34
    Fanatic Member
    Join Date
    Oct 2004
    Posts
    751

    Re: Harnessing the Power of DOS

    Quote Originally Posted by gigemboy
    No you dont "silly pants". What you see looks like DOS but it isnt. Its the command interpreter (cmd.exe), that was made to look similar for a reason (to make you think you are still working in DOS, when you actually aren't, which worked in your case )

    http://commandwindows.com/command1.htm
    The command prompt is run from its own window by invoking the Windows XP command interpreter that is provided by the file cmd.exe located in the folder \Windows\System32\. (The old DOS command interpreter is command.com.) If you look in this folder you may also see several files that look suspiciously like some of the old DOS files. They are, however, different 32-bit versions with many new features.
    Read it more carefully, I wasn't talking about cmd.exe the command interperter, I was talking about command.com the DOS prompt. Go back to the old days, if you have a game like Duke Nukem 3D, and exit and especially if you booted from a book disk and had a disk in that didn't have commmand.com (like a normal boot disk would have) it would complain about it not being avaiable. And it wouldn't let you do anything until you told it where it was located.

    http://en.wikipedia.org/wiki/Command.com

    COMMAND.COM is the name for the default operating system shell (or command line interpreter) for DOS
    So its basically both. Or I don't know anymore.
    Could we at least agree that command.com is more suited for really old DOS programs? Such as Duke Nukem 3D, Heretic (I can only think of games right now ).
    My Projects: [ Instant Messagener Client/Server ] [ VBPictochat ]

    My Sites:
    [ Datanethost ]
    [ Helpdesk ]

    Remember if my post was helpful then Rate This Post.

  35. #35
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Harnessing the Power of DOS

    Duke Nukem 3D doesn't use Command.com.

  36. #36

  37. #37
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Harnessing the Power of DOS

    Quote Originally Posted by RhinoBull
    But recommended way to play was "pure DOS boot"...
    Yes, but that doesn't mean it used command.com. When you run DOS the first thing that is loaded is IO.SYS followed by MSDOS.SYS and last the command line interpreter command.com was loaded. Command.com was however loaded at the very top of the memory area and was allowed to be overwritten by an application that needed that memory. So a DOS application never really used command.com, which was most often unloaded when another program was launched. When you exited that program command.com was loaded again from disk. This was the reason the disk you used to boot the computer with had to be inserted again if it was removed while running another application.

  38. #38

  39. #39

  40. #40
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Harnessing the Power of DOS

    Quote Originally Posted by MartinLiss
    Does this thread have a point any more?
    Yeah I think the point now is that DOS games are old . The fact that nobody writes any DOS games anymore is another evidence that DOS is dead . LOL!!!

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width