Вы находитесь на странице: 1из 5

4

" , "
Windows VBScript/JScript
, Windows,
, , .
WScript,

. ,
WScript, .
, ,
SendKeys.
,
(
[Enter], [Tab], [PageUp] ),
. SendKeys
+ ^ % ~ ( ) { },
. .

[Backspace]
[Break]
[Caps Lock]
[Delete]
[End]
[Enter]
[Home]
[Insert]
[Num Lock]
[Page Down]


{BACKSPACE} {BS} {BKSP}
{BREAK}
{CAPSLOCK}
{DELETE} {DEL}
{END}
{ENTER}
{HOME}
{INSERT} {INS}
{NUMLOCK}
{PGDN}

[Page Up]
[Print Screen]
[Scroll Lock]
[Tab]
[]
[]
[]
[]
[F1]
[F]


{PGUP}
{PRTSC}
{SCROLLLOCK}
{TAB}
{UP}
{LEFT}
{DOWN}
{RIGHT}
{F1}
{F}

[Shift], [Ctrl] [Alt],


.
[Shift]
+
[Ctrl]
^
[Alt]
%
( )
. , [Shift]
[G], [F],
SendKeys "+GF". ,
SendKeys "+(GF)".

,
.
WScript.Sleep( ). ,
, 500 .
,
CreateObject WScript.
, Internet Explorer
JScript:
var vIE=WScript.CreateObject("InternetExplorer.Application");
VBScript :

Set vIE=WScript.CreateObject("InternetExplorer.Application")
-
.
. .
var
vShell=WScript.CreateObject("WScript.Shell");
-, Exec ,
. ,
,
. var vProcess=vShell.Exec("");.
Status, 1
, 0 . ,
while (vProcess.Status==0)
WScript.Sleep(100);. , ExitCode
. ,
StdIn, StdOut -
. MS-DOS
,
%COMSPEC%. , MS-DOS

var vShell=WScript.CreateObject("WScript.Shell");
var vProcess=vShell.Exec("%COMSPEC% /C DIR %SystemRoot% /W");
while (!vProcess.StdOut.AtEndOfStream){
WScript.Echo(vProcess.StdOut.ReadLine());
}
vProcess.ProcessID
,
.

Run WScript.Shell. ,
vShell.Run("calc.exe",1).

0
1

2
3
4
5
6
7
8

VBScript
vbHide

,
.
vbNormalFocus
.
,
.
.
vbMinimizedFocus

( ) .
vbMaximizedFocus

( ) .
vbNormalNoFocus
,
. .
.
vbMinimizedNoFocus ,
, .
.
.
.

10

.
, , ,
.

, VBScript,
, vbHide, .
JScript,
, var vbHide=0;.
Run ,
true false.
, Run
. , , Run
, false.

vShell.AppActivate,
, . ,
, ,
.
,
, .
,
,
. ,
.
Lab4 C:\STUDENT\.
script1.vbs, :
, 9*6= ,
.
script2.vbs, :
, F7+7F=
,
, .
, ,
:
:
.
,
, . ,
.
Scripting.FileSystemObject.
CreateObject.
var FSO=WScript.CreateObject("Scripting.FileSystemObject");
,
/, .
:
CopyFile(" "," "[,overwrite])
, overwrite
,
.

CopyFolder("
","
"[,overwrite])
,
overwrite
.
CreateTextFile("

"[,overwrite])
-. overwrite
,
.
OpenTextFile("

"[,[,create]])
-, create
.
: 1 , 2
, 8 .
CreateFolder("

") .
DeleteFile(" ")
.
DeleteFolder(" ")
.
FileExist(" ")

.
FolderExist(" ")
.
/
-. , .
AtEndOfLine ,
( [Enter]) .
AtEndOfStream ,
.
Close() .
Read(n) n .
ReadAll() .
ReadLine() .
Skip(n) n .
SkipLine() .
Write(text) text.
WriteLine([text])
text .
WriteBlankLines(n) n.

.
Popup WScript.Shell .
( -
). Popup
. Popup(" "[,

][,"
"][,
]). ,


- .
0
1
2
3
4
5
16
32
48
64

VBScript
vbOkOnly
vbOkCancel
vbAbortRetryIgnore
vbYesNoCancel
vbYesNo
vbRetryCancel
vbCritical
vbQuestion
vbExclamation
vbInformation

OK.
. OK Cancel.
Abort, Retry Ignore.
Yes, No Cancel.
Yes No.
Retry Cancel.
Stop.
Question.
Exclamation.
Information.

, ,
VBScript
-1
1
2
3
4
5
6
7

vbOK
vbCancel
vbAbort
vbRetry
vbIgnore
vbYes
vbNo

,
-.
OK..
Cancel.
Abort.
Retry.
Ignore.
Yes.
No.

Popup ,
,
.
script3.js
,
text1.txt.
text2.txt text1.txt.

: 0x , ,
0 , @ . ,
.
+ - * /.
, .
(,
, , ),
.
, ,
.

Оценить