- Aug
- 2,015
- 81
Code:
c:\users\jlc\utils>ver
TCC 24.02.48 x64 Windows 7 [Version 6.1.7601]
Is it possible to make TCC execute this .CMD script, without modification to the .CMD script, without TCC generating errors?
Code:
<# : batch portion
@echo off & setlocal
set "arg=%~1"
powershell -noprofile "iex (${%~f0} | out-string)"
goto :EOF
: end batch / begin powershell #>
# display %arg%
$env:arg
$x="123"
$x
While I am using PowerShell code for this example, this technique can be used with other scripting languages.
I have been doing;
Code:
c:\users\jlc\utils>cmd /c test.cmd
123
...in order to use this technique with no errors from TCC.
Joe