redirect bat commands to cmd window

Home Forums Scripting DOS Command Shell redirect bat commands to cmd window

This topic contains 2 replies, has 2 voices, and was last updated by Avatar georgeeye 8 years, 9 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • Avatar
    shmengie
    Member
    #153280

    i can’t believe i’ve never done this before, and that i can’t figure it out. i have a batch file on my desktop called audit.bat, and this is it:cmd
    cd
    cd xampphtdocsopenauditscripts
    cscript audit.vbs[/CODE]
    simple enough. but, after the cmd command, none of the text is redirecting to the cmd window. so, i rem’d out the cmd command and tried running the bat file from the cmd window, with no luck. (i found a reference to the stdout command which looks like it’s supposed to redirect the text to the cmd window, but that didn’t work, either).

    this has to be so simple and obvious that i’m just overlooking it. can someone please advise?

    thx!

    (ps, i’m running this on w7 pro, if it makes a difference)[CODE]cmd
    cd
    cd xampphtdocsopenauditscripts
    cscript audit.vbs[/CODE]
    simple enough. but, after the cmd command, none of the text is redirecting to the cmd window. so, i rem’d out the cmd command and tried running the bat file from the cmd window, with no luck. (i found a reference to the stdout command which looks like it’s supposed to redirect the text to the cmd window, but that didn’t work, either).

    this has to be so simple and obvious that i’m just overlooking it. can someone please advise?

    thx!

    (ps, i’m running this on w7 pro, if it makes a difference)

    Avatar
    georgeeye
    Member
    #362077

    Re: redirect bat commands to cmd window

    Have you tried it like this:

    cmd /k cscript C:xampphtdocsopenauditscriptsaudit.vbs[/CODE]

    This should open a command window run the command in the string after /k and remain open after it finishes.[CODE]cmd /k cscript C:xampphtdocsopenauditscriptsaudit.vbs[/CODE]

    This should open a command window run the command in the string after /k and remain open after it finishes.

    Avatar
    shmengie
    Member
    #247204

    Re: redirect bat commands to cmd window

    lol, like i said, i knew it would be simple and obvious. thx a mil!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.