The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 895 - File: showthread.php PHP 7.2.34 (Linux)
File Line Function
/showthread.php 895 errorHandler->error




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using pipes in the RunConsole2 function's command
#1
Hi,

The code below, when executed, will output the prompt message: Invalid command.
However, it can be executed successfully in the actual cmd window.

Additionally, the part without the pipe symbol at the end(| findstr /i "diskindex") can be executed successfully.

I know that creating a temporary .bat file can solve the problem, but there is some sensitive information in my command, so I don't want to use a temporary file.

Is there a better solution?

Thanks in advance for any suggestions and help
David

Macro Macro21
Code:
Copy      Help
_s=
;wmic logicaldisk where "VolumeName='Win'" assoc:value /RESULTCLASS:Win32_DiskPartition | findstr /i "diskindex"
RunConsole2 _s


Messages In This Thread
Using pipes in the RunConsole2 function's command - by Davider - 08-28-2023, 12:43 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)