Answer the question
In order to leave comments, you need to log in
ShellExecute and *.cmd, "permission denied" error?
In code:
void MainWindow::on_pushButton_2_clicked()
{
ShellExecute( NULL, L"open", L"C:\\LogWin v.2\\main.cmd", NULL, NULL, SW_SHOWNORMAL );
}
@echo off
:start
for /f "skip=1 tokens=1-3" %%i in ('2^>nul ^
WMIC LogicalDisk ^
WHERE "DriveType='2' AND Name<>'A:' AND Name<>'B:'" ^
GET VolumeSerialNumber^, VolumeName') do (
if -%%j neq - (
pause
echo %%j > fl.txt
attrib +H fl.txt
goto :eof
) else (
msg * /server:127.0.0.1 /w /time:0 "Вставьте, пожалуйста, флешку."
goto :start
)
)
pause
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question