Results 1 to 8 of 8

Thread: do u no your Batch files

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2000
    Posts
    49
    i created a batch file, and my first command is
    cd\
    c:
    file2cd c:\tester
    cdtools /eject
    so when the cd\ execute, it goes automatically to the next line, but after the file2cd command, i nne another ENTER before going to the cdtools command, is there a way to tell him to do a enter with a command.
    thanxs

  2. #2
    Frenzied Member
    Join Date
    Aug 2000
    Location
    O!
    Posts
    1,177
    I'm not sure, but I think you are asking if there is a way to make the batch file wait before executing the cdtools /eject command.

    If this is correct, put the pause command between the file2cd and cdtools commands. Nothing will happen until the user presses a key.

    Code:
    cd\ 
    c: 
    file2cd c:\tester 
    pause
    cdtools /eject

  3. #3
    Frenzied Member mlewis's Avatar
    Join Date
    Sep 2000
    Posts
    1,226
    I'm with ccoder; that sounds to me like what you need.

    Is it?
    M. Lewis
    Pi-Q Software
    How many mouse clicks does it take to cook breakfast?

    Blargh! I am dead!

  4. #4
    Hyperactive Member
    Join Date
    May 2000
    Posts
    344

    Yep

    Coder is right, the pause command will pause until any keey is entered.......You can also add Echo blah blah to walk the person through whats going on so they dont stare at a black screen....assuming you used the cls to clear the commands being entered.
    -RaY
    VB .Net 2010 (Ultimate)

  5. #5
    Guest
    in dos...
    at a prompt...

    type this:

    copy con enter.bat
    'now press the <Enter> key
    'and then press the <F6> function key and
    'then <Enter> key again to save.
    'this batch file will, when called, press
    'Enter for you.

    then in place of the pause type the batch file <enter>

    cd\
    c:
    file2cd c:\tester
    enter
    cdtools /eject


  6. #6
    Frenzied Member
    Join Date
    Aug 2000
    Location
    O!
    Posts
    1,177
    Two things....

    1) You had better use call enter.bat rather than enter or you will never execute the line cdtools /eject. At least that is my experience running cmd.exe (as opposed to command.com) on an NT workstation.

    2) I guess I fail to see what pressing enter (or simulating it) between the 2 commands will do for you. I noticed that you posted another message come back to batch seeking the same answer. Can you enlighten me as to what you are attempting to do?

  7. #7

    Thread Starter
    Member
    Join Date
    Sep 2000
    Posts
    49
    i'm using a shell command in visual basic that call a batch file, shell "shell.bat",vbhide
    in my batch file there is a particular command
    file2cd ("path"), the problem is that i don't see dos cause it's got to be in hide mode, so dos is asking ("if u like to proceed press ENTER or like to cancel press CTL-C.
    So in my batch file, i would like to say to DOS to proceed and by procedding u must press enter in dos.So there must be something i can do in my batch file , a command of a sort to activate the enter button .
    Sorry my english, i suck

  8. #8
    Frenzied Member
    Join Date
    Aug 2000
    Location
    O!
    Posts
    1,177
    Okay, if I understand this, is it DOS that is prompting you to press Enter or Ctrl-C, or is it really the command file2cd?

    If it is file2cd then it might be tricky to respond to it. Especially if file2cd doesn't support I/O redirection.

    It's been quite a while since I did any real batch programming. I seem to remember seeing something at one time or another that was similar to what you are trying to do. Let me look into this and see what I can come up with.




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