Coffeehouse Thread

16 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Help of DOS command/s

Back to Forum: Coffeehouse
  • User profile image
    Raghavendra_​Mudugal

    Hy!

    when you use the command "del *.*" it will prompt you for "y/n", and how we can automate this? Say; I created a batch file with this command, when i run this it will stop at this prompt. Is there any way to set this value "y" and proceed it further? rather than keeping it to wait for user input? So I can put this batch file in the startup folder and delete all those file when PC boots.

    and... by the way (i know)... most of the dos commands are missing in win-xp, so is there a option to get all the commands run under here?

  • User profile image
    littleguru

    del /?

    there's a switch to be quiet Smiley ...

  • User profile image
    TommyCarlier

    littleguru said:
    del /?

    there's a switch to be quiet Smiley ...
    del /q *.*

  • User profile image
    littleguru

    TommyCarlier said:
    littleguru said:
    *snip*
    del /q *.*
    Man, I wanted this to be found out by himself Smiley hehe

  • User profile image
    TommyCarlier

    littleguru said:
    TommyCarlier said:
    *snip*
    Man, I wanted this to be found out by himself Smiley hehe

    Sorry 'bout that. You're right.

    Raghavendra, please follow LG's advice. Learning to know the commands is a good idea.

  • User profile image
    Raghavendra_​Mudugal

    littleguru said:
    del /?

    there's a switch to be quiet Smiley ...
    thank you... littleguru

    i am already done with this...

    cd c:\windows\temp
    del /S /Q *.*

    cd C:\Documents and Settings\RMudugal\Local Settings\Temp
    del /S /Q *.*


    actually... i was trying to automate the key stroke "y" rather than using a flag. Smiley using a flag is like common approach... but key stroking... and automating the input of "y" from the script ... will be cool, I have never tried it before. Big Smile

  • User profile image
    Raghavendra_​Mudugal

    TommyCarlier said:
    littleguru said:
    *snip*

    Sorry 'bout that. You're right.

    Raghavendra, please follow LG's advice. Learning to know the commands is a good idea.

    haha!

    Nice. thanks for this support. Learning... which I always do, if you type at the prompt "help del", you will see all the flags can be used. Smiley

  • User profile image
    Cannot​Resolve​Symbol

    Raghavendra_Mudugal said:
    TommyCarlier said:
    *snip*
    haha!

    Nice. thanks for this support. Learning... which I always do, if you type at the prompt "help del", you will see all the flags can be used. Smiley
    That works for the commands that are built into cmd.exe.  External commands (like ipconfig) won't give you help that way--  on Windows, the convention is to have a /? option that lists all possible command line options.

    On unix/linux/cygwin, most commands will recognize -h or --help to list commands, but you'll be able to get even more information about a command by typing 'man command'.

  • User profile image
    AndyC

    CannotResolveSymbol said:
    Raghavendra_Mudugal said:
    *snip*
    That works for the commands that are built into cmd.exe.  External commands (like ipconfig) won't give you help that way--  on Windows, the convention is to have a /? option that lists all possible command line options.

    On unix/linux/cygwin, most commands will recognize -h or --help to list commands, but you'll be able to get even more information about a command by typing 'man command'.
    And, in Powershell, you should be able to get help on any cmdlet by typing Get-Help command which is altogether a much easier solution.

  • User profile image
    cheong

    Raghavendra_Mudugal said:
    littleguru said:
    *snip*
    thank you... littleguru

    i am already done with this...

    cd c:\windows\temp
    del /S /Q *.*

    cd C:\Documents and Settings\RMudugal\Local Settings\Temp
    del /S /Q *.*


    actually... i was trying to automate the key stroke "y" rather than using a flag. Smiley using a flag is like common approach... but key stroking... and automating the input of "y" from the script ... will be cool, I have never tried it before. Big Smile
    Whenever you need to input something in script but using pipe redirection is not good enough / not applicable, Expect < http://expect.nist.gov/ > comes to my mind.

    P.S.: Link creation not work again.

    Recent Achievement unlocked: Code Avenger Tier 4/6: You see dead program. A lot!
    Last modified
  • User profile image
    NullUserName

    Raghavendra_Mudugal said:
    littleguru said:
    *snip*
    thank you... littleguru

    i am already done with this...

    cd c:\windows\temp
    del /S /Q *.*

    cd C:\Documents and Settings\RMudugal\Local Settings\Temp
    del /S /Q *.*


    actually... i was trying to automate the key stroke "y" rather than using a flag. Smiley using a flag is like common approach... but key stroking... and automating the input of "y" from the script ... will be cool, I have never tried it before. Big Smile

    if you want to automate the input of "y" use this:

            echo y | del *.*

  • User profile image
    Cannot​Resolve​Symbol

    NullUserName said:
    Raghavendra_Mudugal said:
    *snip*

    if you want to automate the input of "y" use this:

            echo y | del *.*

    But that's the wrong way to solve this problem, so don't do it.

    Smiley

  • User profile image
    grassBlade

    CannotResolveSymbol said:
    NullUserName said:
    *snip*
    But that's the wrong way to solve this problem, so don't do it.

    Smiley

    del *.* < whatever.bat
    where 'whatever.bat contains "y" (without quotes)

  • User profile image
    Matthew van Eerde

    for %%f in (*.*) do @del %%f

  • User profile image
    NullUserName

    CannotResolveSymbol said:
    NullUserName said:
    *snip*
    But that's the wrong way to solve this problem, so don't do it.

    Smiley

    oh well, in your opinion it may be the wrong way to do it, but it's what the customer asked for.

    maybe he will see there are many ways to solve this problem.

  • User profile image
    phreaks

    littleguru said:
    del /?

    there's a switch to be quiet Smiley ...
    what's the difference between del and erase?

    I usually use erase /f s q

    You know that the command "help" C:\>help lists all dos commands and all the commands that accept parameters include a /? flag to display the possible switches and their uses...

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.