This may not be as straightforward as you think if we need to support international characters. A DOS command produces its output in an OEM-defined character set, while Windows supports either ANSI or a wide character set. You will observe that using DOS strings directly in windows will result with some odd characters.
Win32 API function OemToCharBuff is designed to address this problem. Perl script below demonstrates how it can be used:
"BOOL OemToCharBuff(LPCTSTR lpszSrc, LPTSTR lpszDst, DWORD cchDstLength)"
# run your DOS command
my $output = `dsquery user domainroot -name tev*`; # A Dos command example
Win32::MsgBox("DOS output: $output", 0, "Before translation");
# Convert OEM to Windows
OemToCharBuff($output, $output, length($output));
Win32::MsgBox("WIN output: $output", 0, "After translation");