.


:




:

































 

 

 

 


, ( ) .




:

intWindowStyle -

bWaitOnReturn - true false, , . true - , . false - .

, intWindowStyle:

 

 
  , ,
 
 
  , ( )
  ,

Run , , . .

, Run , .

Dim WshShell

' WshShell:

Set WshShell = WScript.CreateObject("WScript.Shell")

'

' :

WshShell.Run ("%windir%\notepad " & WScript.ScriptFullName)

 

Windows

Windows , .. SpecialFolders WshShell.

:

object.SpecialFolders(objWshSpecialFolders)

object - WshShell;

objWshSpecialFolders .

 

objWshSpecialFolders
Desktop
Favorites
Fonts
MyDocuments
NetHood , .
PrintHood
Programs ,
Recent ,
SendTo
StartMenu
Startup
Templates

Windows 2000 :

AllUsersDesktop, AllUsersStartMenu, AllUsersPrograms, AllUsersStartup.

 

For For Each...In, WshShell.SpecialFolders. Count .

 

, .

 

Dim WshShell, DesktopPath

Set WshShell = CreateObject("WScript.Shell")

' :

DesktopPath = WshShell.SpecialFolders("Desktop")

MsgBox " : " + DesktopPath

 

 

CreateShortcut

:

object.CreateShortcut(strPathname)

object - WshShell

strPathname - , (, , - ..).

CreateShortcut .

:

1. .

2. .

3.

 

Dim WshShell, DesktopPath, Nshortcut

' WshShell:

Set WshShell = CreateObject("WScript.Shell")

' :

DesktopPath = WshShell.SpecialFolders("Desktop")

' :

Set NShortcut = WshShell.CreateShortcut(DesktopPath & "\.lnk")

 

, :

TargetPath .

WindowStyle .

:

1 ;

3 ;

7 .

HotKey

IconLocation , .exe .dll , 0. , Moricons.dll Shell32.dll, Windows \System. .bmp.ico-.

Description ()

WorkingDirectory , .

 

, , Save.

, :

VBScript:

Dim WshShell, DesktopPath, Nshortcut

' WshShell:

Set WshShell = CreateObject("WScript.Shell")

' :

DesktopPath = WshShell.SpecialFolders("Desktop")

' :

Set NShortcut = WshShell.CreateShortcut(DesktopPath & "\.lnk")

' API "%windir%"

'WINDOWS

'TargetPath:

NShortcut.TargetPath = "%windir%\notepad.exe"

' :

NShortcut.WindowStyle = 1

' :

NShortcut.Hotkey = "CTRL+ALT+f"

' :

NShortcut.IconLocation = "notepad.exe, 0"

' :

NShortcut.Description = " "

' - :

NShortcut.WorkingDirectory = DesktopPath

' :

NShortcut.Save

 

. Microsoft.

 

Dim WshShell, UrlLink

Set WshShell = WScript.CreateObject("WScript.Shell")

Set UrlLink = WshShell.CreateShortcut("Microsoft.URL")

UrlLink.TargetPath = "http://www.microsoft.com"

UrlLink.Save





:


: 2016-12-04; !; : 614 |


:

:

80% - .
==> ...

1356 - | 1216 -


© 2015-2024 lektsii.org - -

: 0.014 .