vbscript - Unable to run .vbs script from my C# program: "The system cannot find the file specified." -
i'm trying run easy .vbs script c# program, keep getting error.
i'm 100% sure path correct! know problem? run.vbs alone runs fine (also system_logged.bat runs fine)
inside .vbs call batch file , dump error logs, nothing more.
run.vbs:
set wshshell = wscript.createobject("wscript.shell") obj = wshshell.run("system_logged.bat", 0) set wshshell = nothing
system_logged.bat:
adb shell "su -c 'dd if=/dev/block/mmcblk0p23 of=/storage/sdcard1/system.img bs=4096'" > "output.txt" 2>&1
since error message reports error coming line:
obj = wshshell.run("system_logged.bat", 0)
my assumption script cannot locate system_logged.bat
. try supplying full path bat
file in script. if there spaces in path, you'll need enclose in quotes. in vbscript, you'll need escape quotes in string literals doubling them:
obj = wshshell.run("""c:\path spaces\system_logged.bat""", 0)
the reason may work when running on own because of execution context in it's run. when launched c#
app, default working directory different wscript uses when launched on own.
Comments
Post a Comment