Help Dos command thingy problem.

old.Tohtori

FH is my second home
Joined
Jan 23, 2004
Messages
45,210
I have a command that opens a "y/n" thing, but i can't add the "y" as automatic to the command.

As in, i want it to do this:

Do command.
Wait 2 seconds.
answer a certain way into a list type of thing.

etc.

What's the command for answering those "dropdown" question thingies?

Ain't i technical :D
 

Binky the Bomb

Fledgling Freddie
Joined
Jan 31, 2004
Messages
1,897
I've been told the answer is "For someone without any programing the knowledge, your chance of writing the util is nil".

For the effort to make it, your better off just putting Y in yourself.

What exactly is it for? I may know someone with more info for you.
 

old.Tohtori

FH is my second home
Joined
Jan 23, 2004
Messages
45,210
I've been told the answer is "For someone without any programing the knowledge, your chance of writing the util is nil".

For the effort to make it, your better off just putting Y in yourself.

What exactly is it for? I may know someone with more info for you.

Well work thing really, just messinga bout to ease my life :)

The thing is, i have to do this now before i type the y a million times, and that time a shorter command thingy would've helped :D

And it's not really about effort, more about, "it would be cool".
 

Binky the Bomb

Fledgling Freddie
Joined
Jan 31, 2004
Messages
1,897
Is this a program thats asking or input one after the other?
Or do you do this at random intervals?
 

Bahumat

FH is my second home
Joined
Jun 22, 2004
Messages
16,788
How about that nodding duck like in the Simpsons?

Sorry I cant help :(
 

old.Tohtori

FH is my second home
Joined
Jan 23, 2004
Messages
45,210
Is this a program thats asking or input one after the other?
Or do you do this at random intervals?

It's rather random. I'm basically trying to make an automated "format c:" thing, but the question part is giving me problems.

Not actual "format c" though :D

How about that nodding duck like in the Simpsons?

Sorry I cant help :(

Tempted to put one on my desk :p
 

Binky the Bomb

Fledgling Freddie
Joined
Jan 31, 2004
Messages
1,897
It's rather random. I'm basically trying to make an automated "format c:" thing, but the question part is giving me problems.

Not actual "format c" though :D

Well, my dads a programmer, and he's said the question is there for a reason (I.E. to stop virus writers from wiping drives without aid). There is something called 'Keybuff' that could help (DOS Utility)... although I am curious as to WHY you'd want to get round the Y/N security answer for the Format C:
 

soze

I am a FH squatter
Joined
Jan 22, 2004
Messages
12,508
I have been told creating a txt document called y.txt with just "y(carriage return)" in it and then adding "< path\y.txt" to the end of the command will tell it to find its answer in the file and could work.
 

old.Tohtori

FH is my second home
Joined
Jan 23, 2004
Messages
45,210
Well, my dads a programmer, and he's said the question is there for a reason (I.E. to stop virus writers from wiping drives without aid). There is something called 'Keybuff' that could help (DOS Utility)... although I am curious as to WHY you'd want to get round the Y/N security answer for the Format C:

As i said "it's not format C:", just that it explains what i need better :D

I have been told creating a txt document called y.txt with just "y(carriage return)" in it and then adding "< path\y.txt" to the end of the command will tell it to find its answer in the file and could work.

Wonderful, works like a charm, thanks :D

Now, where to put the command so that it works in whole dos? :eek6:
 

soze

I am a FH squatter
Joined
Jan 22, 2004
Messages
12,508
Wonderful, works like a charm, thanks :D

Now, where to put the command so that it works in whole dos? :eek6:

Dont get what you mean sorry you want it to run in dos outside of windows? Either way easiest bet would be crating a bat file with you command in it maybe?
 

old.Tohtori

FH is my second home
Joined
Jan 23, 2004
Messages
45,210
Dont get what you mean sorry you want it to run in dos outside of windows? Either way easiest bet would be crating a bat file with you command in it maybe?

Ah meant that, where should the .bat file go for it to work in all directories in dos(can't remember sh*t of this).

Also, i have one command, which works fine, but after that i got an "auto delete" thing, but it doesn't seem to work :eek7:
 

soze

I am a FH squatter
Joined
Jan 22, 2004
Messages
12,508
Ah meant that, where should the .bat file go for it to work in all directories in dos(can't remember sh*t of this).

Also, i have one command, which works fine, but after that i got an "auto delete" thing, but it doesn't seem to work :eek7:

What is it your trying to do and i will have to have a think, i like messing around in dos and my boss knows about 4 billion strange commands :)
 

old.Tohtori

FH is my second home
Joined
Jan 23, 2004
Messages
45,210
What is it your trying to do and i will have to have a think, i like messing around in dos and my boss knows about 4 billion strange commands :)

It's basically adding a package to a server, i want it to do this:

- Go to destination.
- Add package to server(command) and answer 0(list thing).

So far it works.

But i can't get it to empty the destination folder, aka del *.*, to work after it adds the package(package adding takes about 10 seconds).
 

Chronictank

FH is my second home
Joined
Jan 21, 2004
Messages
10,133
Code:
@echo off
REM Batch file to proove option paths

:MAIN

setlocal
REM This bit gets the user responce, in command prompt do "set /?" for more flags than /p
set /p Responce=Would you like to do something, please enter Y/N:
REM If statement, if capital Y is entered then go to the section :YES below
if {%Responce%}=={Y} goto :YES

if {%Responce%}=={N} goto :NO

REM If Capital Y or N is not entered go back to start and prompt user again
ECHO something is broken resetting...
goto :Main

:YES
REM if user selects YES, put statements here
echo entered Yes
pause

:NO
REM else statements go here
echo entered No
pause
 

soze

I am a FH squatter
Joined
Jan 22, 2004
Messages
12,508
It's basically adding a package to a server, i want it to do this:

- Go to destination.
- Add package to server(command) and answer 0(list thing).

So far it works.

But i can't get it to empty the destination folder, aka del *.*, to work after it adds the package(package adding takes about 10 seconds).

Ok the way i have always done this kind of thing is to insert pings

rename C:\test.txt test2.txt
ping arsenal.com
ping microsoft.com
rename C:\test2.txt test3.txt

The more sites that do not reply the longer it will take. So maybe if you have them too between line one and 2 it will delay it long enough to run.

There are real delay prgrammes but they have to be saved locally i think.
 

Chronictank

FH is my second home
Joined
Jan 21, 2004
Messages
10,133
ah sorry misunderstood what you wanted, will look alter as i got to do stuff at the mo

Any chance you could add your code, its hard troubleshooting without knowing what you are troubleshooting :p

If you are trying to delete read-only files you need to add the /F flag, in addiiton if you want to make sure you get no prompts in the deleting process you can make it quite by doing /Q

so
del <path>/* /F /Q
 

old.Tohtori

FH is my second home
Joined
Jan 23, 2004
Messages
45,210
Reps all around, i got my megacommand :D

Funny thing, i forgot that the del was automated and tested this command in it's own folder and the command deleted itself :flame:
 

old.Tohtori

FH is my second home
Joined
Jan 23, 2004
Messages
45,210
More haha work for you if you will:

How to make a "list" command;

As in:

-I've got location A, B, C, D etc that i wish to go to.
-I want the command, let's say "list", to create a numerical list in dos where the locations are listed

1: A
2: B
3: C

Etc.

with the last part being: "Select choice: " where you can put the number.

Basically a "quickjump" list.

I think i have to list the commands that take to that particular place, on the list, but same difference really.
 

Chronictank

FH is my second home
Joined
Jan 21, 2004
Messages
10,133
so you want a list where users can choose what to do?

What you could use is the CHOICE parameter

for example:

ECHO 1 - option1
ECHO 2 - option2
ECHO 3 - option3

CHOICE /C:123

IF errorlevel 3 goto something
IF errorlevel 2 goto something
IF errorlevel 1 goto something

Note that you need to put the error levels in reverse order

This is a much cleaner way of doing it opposed to multiple if statements on the back of a set, but doesnt work on all versions of DOS

To be honest rather than hacking this i think you may want to try write this in vbscript as it is closer to a real programming language and lets you do more
 

old.Tohtori

FH is my second home
Joined
Jan 23, 2004
Messages
45,210
The thing is, i've alst done some dos .bat thingies when i was 12 and haven't touched coding thingies of any sort since :D

I'm a dumbdumb when it comes to this, but keen to learn and upgrade some systems.

Also there'a a bit of a "dare" that it can't be done in dos with .bat ;)
 

Users who are viewing this thread

Top Bottom