Вызов Exec и двойные кавычки

Russian main discussion
  • Author
  • Message
Offline
Posts: 2247
Joined: Tue Aug 07, 2007 2:03 pm
Location: Vinnitsa, Ukraine

Post by FeyFre »

Andrey_A_A
Exec("start /min /wait %ComSpec% /c taskkill /f /im wscript.exe")
по-моему так

Offline
Posts: 670
Joined: Thu Jun 03, 2010 8:47 am
Location: Сочи, Хоста
Contact:

Post by Andrey_A_A »

FeyFre, что-то не срабатывает, я уже тоже что только не вставлял, не хочет

добавлено через 5 мин

сработал такой вариант, но всё равно окно мелькает, но побыстрее
Exec("%ComSpec% /c start /min taskkill /f /im wscript.exe")

KDJ
Offline
Posts: 1949
Joined: Sat Mar 06, 2010 7:40 pm
Location: Poland

Post by KDJ »

Andrey_A_A
You can not hide console window (cmd.exe), the above methods.
One way is to use link file (eg. ...\AkelPad\WscriptKill.lnk):
"Wscript kill" Exec("rundll32.exe shell32, ShellExec_RunDLL %a\WscriptKill.lnk")

Command in the link:
%ComSpec% /c taskkill /f /im Wscript.exe
and run as minimized.

Image

KDJ
Offline
Posts: 1949
Joined: Sat Mar 06, 2010 7:40 pm
Location: Poland

Post by KDJ »

Another way is to use software tools to hide the console window or to kill processes.
On this subject, read here:
Russian: http://wiki.oszone.net/index.php/%D0%A1 ... 0%BD%D0%B0
Polish: http://www.searchengines.pl/Ukrywanie-o ... 02791.html

Example of using nircmd.exe ( http://www.nirsoft.net/utils/nircmd.html ):
"Wscript kill" Exec("%a\nircmd.exe killprocess Wscript.exe")
Nircmd.exe file located in AkelPad directory.

Offline
Posts: 670
Joined: Thu Jun 03, 2010 8:47 am
Location: Сочи, Хоста
Contact:

Post by Andrey_A_A »

Спасибо KDJ за подсказку. Получилось!
"Завершить процесс Wscript.exe Ctrl+Shift+Alt+W" Exec(`"%a\AkelFiles\Tools\NirCmd\NirCmd.exe" execmd taskkill /f /im wscript.exe`) Icon("%a\AkelPadImage.dll",528)
Post Reply