Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Execute the command-line code
#1
Hi,

The code below works fine in QM, How to run in LA

Macro Macro24
 
Code:
Copy      Help
_s=
;@echo off
;set name=hello 你好
;for /l %%i in (0,1,5) do (
;;;;;echo %name%
;)

__TempFile f.Init(".bat" "" "" _s)
RunConsole2(f _s "" 0x800)
mes _s


Run failed:
 
Code:
Copy      Help
var commands = """
@echo off
set name=hello 你好
for /l %%i in (0,1,5) do (
    echo %name%
)
"""
;
commands = commands.Replace("\r\n", " && ");
run.console("cmd.exe", $@"/u /c ""{commands}""", encoding: Encoding.Unicode);


Run failed:
Code:
Copy      Help
var commands = """
@echo off
set name=hello 你好
for /l %%i in (0,1,5) do (
    echo %name%
)
"""
;
string file1 = folders.ThisAppTemp + "bat.bat";
filesystem.saveText(file1, commands, encoding: Encoding.Default);
run.console("cmd.exe", $"{file1}", encoding: Encoding.Default);


Messages In This Thread
Execute the command-line code - by Davider - 11-14-2022, 01:06 AM
RE: Execute the command-line code - by Gintaras - 11-14-2022, 04:49 AM
RE: Execute the command-line code - by Davider - 11-14-2022, 05:25 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)