VB equivalent to powershell -


i new powershell , question may simple

can please please tell me equivalent following(vbscript) in powershell

set obj = wscript.createobject( wscript.shell )   obj.run $smcmnd   

what use of wscript.shell.
after bit of search found first line can presented as;

$obj  = new-object -comobject wscript.shell   

but have have no idea how call run method ($obj.run(...)???)

if run cmd.exe commands smcmnd, how can keep cmd.exe without close , run command later in same console??

edit
writing ps script , call application. folder creations , file coping etc. open cmd.exe , show commands running on that. how use same cmd prompt through out whole script.

is smcmnd string of shell commands? if so, can call them directly powershell, without trying wscript.shell com object run them against you'd need in vbscript.

vbscript wasn't shell. powershell is. can write shell commands directly in .ps1 or .ps2 files, in batch file.

i'm not powershell expert here, try doing

& $smcmnd 

Comments