Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

making a .bat file?

Status
Not open for further replies.

kameleon80

IS-IT--Management
Jan 7, 2003
53
0
0
US
what is the syntax for answering a question when you run a .bat file?
 
Can you elaborate a little with an example please, this is not saying anything.

The 'syntax' for answering depends on the question

Marc
[sub]If 'something' 'somewhere' gives 'some' error, expect random guesses or no replies at all. Please specify details.
Free Tip: The F1 Key does NOT destroy your PC!
[/sub]
 
for example if you wanted del a file in a folder in a dos shell it asks "Are you sure you want to del this file"(Y/N)?


I would like for me to just run the .bat file and it answer with a "Y" for me instead of me having to see the question.
 
a del of a file does not ask you that, only a del *.*

Marc
[sub]If 'something' 'somewhere' gives 'some' error, expect random guesses or no replies at all. Please specify details.
Free Tip: The F1 Key does NOT destroy your PC!
[/sub]
 
that was just an example.. that isn't what the .bat file is doing but thanks for the fast response time...
 
that still does not tell us what the problem is?
Just saying 'yes' to something? Is that it?


Marc
[sub]If 'something' 'somewhere' gives 'some' error, expect random guesses or no replies at all. Please specify details.
Free Tip: The F1 Key does NOT destroy your PC!
[/sub]
 
So you want your batch to run without asking you anything? Anyway most of the dos command there's a corresponding switch to suppress additional input from you.

Like:

del *.* /q will not ask you anything, it will just delete everything.

How did I found out the /q, I just type del/? on the command prompt then it will give me options how I want to delete a file. If I want to copy a file without prompting me to overite it I just use /y.. copy a:\*.* /y.
 
thanks guys for the responses that's what I was looking for but I can't do what I was thinking of... I'm trying to make a .bat file that runs a program with another users rights with the runas command... I could then use NTFS permissions to give permission to people who needs to run the program... :(
 
Now you're talking, but can't help, I never tried that before. I will do experimenting first but not now..

Anyone??
 
Maybe u could call in another .bat file? Not much of a programmer but I believe that this could be done somehow. Please let me know if you come up with anything and thanks again for everything.


Good luck and I'll keep trying also.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top