Имя пользователя:
Пароль:
 

Показать сообщение отдельно

Ветеран


Сообщения: 27449
Благодарности: 8088

Профиль | Отправить PM | Цитировать


Лучше так:
читать дальше »
Код: Выделить весь код

Код: Выделить весь код
Option Explicit

With WScript.CreateObject("WScript.Shell")
	Do
		WScript.Sleep 100
	Loop Until .AppActivate("Имя папки")
	
	.Run "%SystemRoot%\system32\notepad.exe"
End With

WScript.Quit 0

Но отнюдь не:
Цитата Georgio:
В примере после запуска скрипа при открытии в любом месте компьютера любой папки с именем "Имя папки" запустится "Блокнот" »
А «в примере после запуска скрипта при открытии в любом месте компьютера» любого приложения, чей заголовок не только совпадает, но так же начинается, либо оканчивается на «Имя папки» — «запустится «Блокнот»:
Цитата:
The AppActivate method returns a Boolean value that identifies whether the procedure call is successful. This method changes the focus to the named application or window, but it does not affect whether it is maximized or minimized. Focus moves from the activated application window when the user takes action to change the focus (or closes the window).

In determining which application to activate, the specified title is compared to the title string of each running application. If no exact match exists, any application whose title string begins with title is activated. If an application still cannot be found, any application whose title string ends with title is activated. If more than one instance of the application named by title exists, one instance is arbitrarily activated.

Отправлено: 05:16, 28-04-2013 | #4