windows - I need to automate running commands in CMD with a batch file -


i need project. goal open batch program open cmd, automatically run few commands. have tried couple scripts found online. happens cmd opens, shows few errors "end not internal or external command.", closes. helpful if 1 of guys gave me batch script input commands into, make batch program.

also, don't think matter running windows 8.1 on 64-bit computer.

p.s. here script used before:

private sub cmdautomate()     dim sipdomain textbox = txtcommand     dim myprocess new process     dim startinfo new system.diagnostics.processstartinfo     startinfo.filename = "cmd"     startinfo.redirectstandardinput = true     startinfo.redirectstandardoutput = true     startinfo.useshellexecute = false     startinfo.createnowindow = true     myprocess.startinfo = startinfo     myprocess.start()     dim sr system.io.streamreader = myprocess.standardoutput     dim sw system.io.streamwriter = myprocess.standardinput      sw.writeline(**command want enter**)     sw.writeline(**command want enter**)     sw.writeline(**command want enter**)     sw.writeline(**command want enter**)     sw.writeline(**command want enter**)     sw.writeline("exit")     results = sr.readtoend     sw.close()     sr.close()     invoke(finished) end sub 

first of all, please improve english.

it sounds want run commands with

sw.writeline(**command want enter**) sw.writeline(**command want enter**) sw.writeline(**command want enter**) sw.writeline(**command want enter**) sw.writeline(**command want enter**) 

in case, there sendkeys.send() class in .net, can use. try sendkeys.send()

i c#, not vb. think work


Comments

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -