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?
-
-
del /?
there's a switch to be quiet
... -
del /q *.*littleguru said:del /?
there's a switch to be quiet
... -
Man, I wanted this to be found out by himselfTommyCarlier said:
del /q *.*littleguru said:*snip*
hehe
-
littleguru said:
Man, I wanted this to be found out by himselfTommyCarlier said:*snip*
heheSorry 'bout that. You're right.
Raghavendra, please follow LG's advice. Learning to know the commands is a good idea.
-
thank you... littlegurulittleguru said:del /?
there's a switch to be quiet
...
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.
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. 
-
haha!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.
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.
-
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.Raghavendra_Mudugal said:
haha!TommyCarlier said:*snip*
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.
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.CannotResolveSymbol said:
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.Raghavendra_Mudugal said:*snip*
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'.
-
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.Raghavendra_Mudugal said:
thank you... littlegurulittleguru said:*snip*
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.
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.

P.S.: Link creation not work again.
-
Raghavendra_Mudugal said:
thank you... littlegurulittleguru said:*snip*
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.
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.

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.NullUserName said:Raghavendra_Mudugal said:*snip*if you want to automate the input of "y" use this:
echo y | del *.*

-
del *.* < whatever.batCannotResolveSymbol said:
But that's the wrong way to solve this problem, so don't do it.NullUserName said:*snip*

where 'whatever.bat contains "y" (without quotes) -
for %%f in (*.*) do @del %%f
-
CannotResolveSymbol said:
But that's the wrong way to solve this problem, so don't do it.NullUserName said:*snip*

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. -
what's the difference between del and erase?littleguru said:del /?
there's a switch to be quiet
...
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...
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.