convert batch file to executable
Hello to all the dos experts. I hope you could help me with this simple batch commands that uses environment variable to output it to a text file.
Code:
@echo off
echo setl "SU_COMMANDLINE=%COMSPEC% /c start c:\winnt\system32\command.com /Q /I" >%temp%\trash.kix
echo setl "SU_PASSWORD=password" >>%temp%\trash.kix
echo go C: >>%temp%\trash.kix
echo $cmd=ExpandEnvironmentVars(CHR(37)+comspec+CHR(37)) >>%temp%\trash.kix
echo shell $cmd+' /c dir c:\windows\*.ini /w' >>%temp%\trash.kix
echo ; shell $cmd+' /c su userid -l -e -cb -w' >>%temp%\trash.kix
echo $tmp=ExpandEnvironmentVars(CHR(37)+temp+CHR(37)) >>%temp%\trash.kix
echo ; del $tmp+'\trash.kix' >>%temp%\trash.kix
kix32 %temp%\trash.kix
@echo off
This batch works in batch mode. When I convert it to a com file using Bat2exec program, it doesn't work. Can anyone help?