Running Windows Script Files


The Windows Script Host enables users to write and execute scripts in VBScript, JavaScript, and other languages compatible with the Windows environment. It was initially developed as an additional component, but since Windows 98 it is integrated into all new editions of Windows operating system.

Script files usually have .vbs and .js extensions. They are executed from the Windows environment using wscript.exe or from the command prompt using csript.exe.

Execution of script files can also be initiated from Transact-SQL code. The following statement runs a demo script that starts Excel and populates a worksheet with information:

 exec xp_cmdshell 'c:\windows\command\cscript.exe '      + 'c:\windows\samples\wsh\Excel.vbs', NO_OUTPUT 




Microsoft SQL Server 2005 Stored Procedure Programming in T-SQL &  .NET
Microsoft SQL Server 2005 Stored Procedure Programming in T-SQL & .NET
ISBN: 0072262281
EAN: 2147483647
Year: 2006
Pages: 165

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net