Search is not available for this dataset
content stringlengths 0 376M |
|---|
' This script will delete all non-english display specifers in the
' forest the local machine is joined to.
'
' (This is useful for testing a dcpromo.csv file by cleaning out
' the display specifiers container prior to running csvde)
option explicit
on error resume next
const HRESULT_ERROR_DS_NO_SUCH_OBJEC... |
<reponame>npocmaka/Windows-Server-2003
set fso = CreateObject("Scripting.FileSystemObject")
set rptfile = fso.CreateTextFile("builder\logs\report.txt")
' Check msm/msi build logs
Function CheckVSILog(inputfile)
set logfile = fso.GetFile(inputfile)
set logstream = logfile.OpenAsTextStream
success = False
Ch... |
dim pack
set pack = new carddeck
wscript.echo "--before shuffle"
pack.showdeck
pack.shuffle
wscript.echo "--after shuffle"
pack.showdeck
dim card
for i = 1 to 52
set card = pack.deal
next
wscript.echo "--dealt a card, it's the", card.pips, "of", card.suit
wscript.echo "--", pack.cardsRemaining, "cards remaining"
if p... |
'----------------------------------------------------------------------
'
' Copyright (c) Microsoft Corporation. All rights reserved.
'
' Abstract:
'
' prncnfg.vbs - printer configuration script for WMI on Whistler used to get
' and set printer configuration also used to rename a printer
'
' Usage:
' prn... |
<filename>Task/Top-rank-per-group/VBA/top-rank-per-group.vba
Private Sub top_rank(filename As String, n As Integer)
Workbooks.OpenText filename:=filename, Comma:=True
Dim ws As Worksheet
Set ws = Sheets.Add: ws.Name = "output"
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
... |
'***************************************************************************
'This script tests the manipulation of property values, in the case that the
'property is an embedded type
'***************************************************************************
Set Service = GetObject("winmgmts:root/default")
On ... |
20 DATA 1,3,5,7,9
30 PRINT "hi"
40 READ y
50 PRINT y
60 READ x
70 PRINT x
80 RESTORE
90 READ z
90 PRINT z
|
Option Explicit
'----------------------------------------------------------------------
Function TransposeMatrix(InitMatrix() As Long, TransposedMatrix() As Long)
Dim l1 As Long, l2 As Long, u1 As Long, u2 As Long, r As Long, c As Long
l1 = LBound(InitMatrix, 1)
l2 = LBound(InitMatrix, 2)
u1 = UBound(InitMatrix, ... |
option explicit
'~ dim depth
function ack(m, n)
'~ wscript.stdout.write depth & " "
if m = 0 then
'~ depth = depth + 1
ack = n + 1
'~ depth = depth - 1
elseif m > 0 and n = 0 then
'~ depth = depth + 1
ack = ack(m - 1, 1)
'~ depth = depth - 1
'~ elseif m > 0 and n > 0 then
else
'~ depth = depth + 1
... |
<reponame>LaudateCorpus1/RosettaCodeData<gh_stars>1-10
Option Explicit
Sub Main()
'See Output First call
OtherWay "C:\Users\" & Environ("username") & "\Desktop\foobar.txt", 11, 5
'See Output Second call
OtherWay "C:\Users\" & Environ("username") & "\Desktop\foobar.txt", 8, 5
'See Output Third call
Ot... |
<reponame>hanun2999/Altium-Schematic-Parser
'..............................................................................
' Summary Returns the Microsoft Scripting Engine version no.
' Copyright (c) 2004 by Altium Limited
'..............................................................................
'................ |
Option Explicit
Declare Function ffun Lib "vbafun" (ByRef x As Double, ByRef y As Double) As Double
Sub Test()
Dim x As Double, y As Double
x = 2#
y = 10#
Debug.Print ffun(x, y)
End Sub
|
<filename>Task/Word-wrap/VBScript/word-wrap.vb
column = 60
text = "In olden times when wishing still helped one, there lived a king " &_
"whose daughters were all beautiful, but the youngest was so beautiful "&_
"that the sun itself, which has seen so much, was astonished whenever "&_
"it shone-in-her-face. Close-b... |
<reponame>npocmaka/Windows-Server-2003<filename>net/unimodem/tools/src/frmresponse.frm<gh_stars>10-100
VERSION 5.00
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "COMCTL32.OCX"
Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
Begin VB.Form frmResponse
BorderStyle = 0 'No... |
<reponame>mullikine/RosettaCodeData
Set objXMLDoc = CreateObject("msxml2.domdocument")
objXMLDoc.load("In.xml")
Set item_nodes = objXMLDoc.selectNodes("//item")
i = 1
For Each item In item_nodes
If i = 1 Then
WScript.StdOut.Write item.xml
WScript.StdOut.WriteBlankLines(2)
Exit For
End If
Next
Set price_nodes... |
<gh_stars>10-100
on error resume next
set service = getobject("winmgmts:{impersonationLevel=impersonate,(shutdown)}")
set osset = service.instancesof ("Win32_OperatingSystem")
for each os in osset
result = os.Shutdown ()
if err <> 0 then
WScript.Echo Hex(Err.Number), Err.Description
else
WScript.Ec... |
10 INPUT "Input a number ",num
20 PRINT num
|
<filename>ips/mbist/READONLY_LVISION_MEM0_INTERFACE.vb
/*
----------------------------------------------------------------------------------
- -
- Copyright Mentor Graphics Corporation -
- All Rights... |
'Initialize the r and the s arrays.
Set r = CreateObject("System.Collections.ArrayList")
Set s = CreateObject("System.Collections.ArrayList")
'Set initial values of r.
r.Add "" : r.Add 1
'Set initial values of s.
s.Add "" : s.Add 2
'Populate the r and the s arrays.
For i = 2 To 1000
ffr(i)
ffs(i)
Next
'r functio... |
<reponame>npocmaka/Windows-Server-2003<filename>admin/wmi/wbem/scripting/samples/admin/share.vbs
'********************************************************************
'*
'* File: SHARE.VBS
'* Created: July 1998
'* Version: 1.0
'*
'* Main Function: Lists, creates, or deletes shares from a... |
'----------------------------------------------------------------------
'
' Copyright (c) Microsoft Corporation. All rights reserved.
'
' Abstract:
' prnport.vbs - Port script for WMI on Whistler
' used to add, delete and list ports
' also for getting and setting the port configuration
'
' Usage:
' pr... |
<reponame>npocmaka/Windows-Server-2003
on error resume next
const wbemPrivilegeCreateToken = 1
const wbemPrivilegePrimaryToken = 2
const wbemPrivilegeLockMemory = 3
const wbemPrivilegeIncreaseQuota = 4
const wbemPrivilegeMachineAccount = 5
const wbemPrivilegeTcb = 6
const wbemPrivilegeSecurity = 7
const wbemP... |
<reponame>npocmaka/Windows-Server-2003
on error resume next
set service = GetObject("winmgmts:")
while true
service.Get ("Win32_Service")
wend |
10 GOSUB 100
20 END
30 PRINT "UNREACHABLE"
100 PRINT "hi"
110 RETURN
|
set processes = getobject("wmi:").InstancesOf ("Win32_Process")
for each p in processes
Wscript.echo p.name
next |
10 LET S$="abc123"
20 PRINT LEN (S$)
30 PRINT RIGHT$(S$,2)
40 PRINT LEFT$(S$,2)
50 PRINT MID$(S$,1,1)
60 PRINT "abc";"xyz"
70 PRINT STR$(11.2)
80 PRINT VAL("500")
|
'***************************************************************************
'This script tests the setting of null property values and passing of
'null values to methods
'***************************************************************************
On Error Resume Next
Set Locator = CreateObject("WbemScripting.SW... |
<gh_stars>1-10
sub Assert( boolExpr, strOnFail )
if not boolExpr then
Err.Raise vbObjectError + 99999, , strOnFail
end if
end sub
|
<reponame>npocmaka/Windows-Server-2003
on error resume next
set service = GetObject("winmgmts:{impersonationLevel=impersonate}!Win32_Service=""SNMP""")
result = service.Create ("Fred", "Frederick", "c:\\temp", , , "Manual", ,,"fred", "A", Array("A", "BB", "CCC"), Array("D"))
if err <>0 then
WScript.Echo Hex(... |
'stop
Set obj = CreateObject( "UploadManager.MPCUpload" )
Function LookUpStatus( stat )
Select Case stat
Case 0 LookUpStatus = "UL_NOTACTIVE"
Case 1 LookUpStatus = "UL_ACTIVE"
Case 2 LookUpStatus = "UL_SUSPENDED"
Case 3 LookUpStatus = "UL_TRANSMITTING"
... |
<filename>base/ntsetup/opktools/wpebins/buildoptionalcomponents.vbs
OPTION EXPLICIT
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'-----Windows Script Host script to generate components needed to run WSH, HTA, or
'-----ADO (for Microsoft SQL Server connectivity) under Windows ... |
Sub spiral(n As Integer)
Const FREE = -9 'negative number indicates unoccupied cell
Dim A() As Integer
Dim rowdelta(3) As Integer
Dim coldelta(3) As Integer
'initialize A to a matrix with an extra "border" of occupied cells
'this avoids having to test if we've reached the edge of the matrix
ReDim... |
verifydistribution "dice7", 1000, 0.03
verifydistribution "dice7", 100000, 0.03
|
<gh_stars>10-100
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 'Windo... |
Function StringCase()
Dim s As String
s = "alphaBETA"
Debug.Print UCase(s)
Debug.Print LCase(s)
Debug.Print WorksheetFunction.Proper(s)
End Function
|
<gh_stars>1-10
Sub foo1()
err.raise(vbObjectError + 1050)
End Sub
Sub foo2()
Error vbObjectError + 1051
End Sub
|
<reponame>LaudateCorpus1/RosettaCodeData
Sub test()
Dim a As Integer
a = 41
Debug.Assert a = 42
End Sub
|
<gh_stars>1-10
Option Explicit
Sub Main_Bulls_And_Cows_Player()
Dim collSoluces As New Collection, Elem As Variant, Soluce As String
Dim strNumber As String, cpt As Byte, p As Byte
Dim i As Byte, Bulls() As Boolean, NbBulls As Byte, Cows As Byte, Poss As Long
Const NUMBER_OF_DIGITS As Byte = 4
strNumber = Cre... |
<reponame>LaudateCorpus1/RosettaCodeData
Debug.Print Hex(MaskL(8)) 'FF000000
Debug.Print Hex(MaskR(8)) 'FF
Debug.Print Hex(Bit(7)) '80
Debug.Print Hex(ShiftL(-1, 8)) 'FFFFFF00
Debug.Print Hex(ShiftL(-1, -8)) 'FFFFFF
Debug.Print Hex(ShiftR(-1, 8)) 'FF... |
Function BackupFiles()
dim fso
dim strWindows
dim strNewName
dim strCurrentName
on error resume next
strWindows = Session.Property( "WindowsFolder" )
strNewName = strWindows & "Help\suptoolsold.chm"
strCurrentName = strWindows & "Help\suptools.chm"
set fso = createobject( "scripting.filesystem... |
Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
On Error Resume Next
WshShell.RegDelete "HKLM\software\Microsoft\ServerAppliance\ElementManager\WebElementDefinitions\TabsMail\"
WshShell.RegDelete "HKLM\software\Microsoft\ServerAppliance\ElementManager\WebElementDefinitions\TabsMailMasterSettin... |
<reponame>npocmaka/Windows-Server-2003
Public Class ListForm
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initia... |
Public Sub quine()
quote = Chr(34)
comma = Chr(44)
cont = Chr(32) & Chr(95)
n = Array( _
"Public Sub quine()", _
" quote = Chr(34)", _
" comma = Chr(44)", _
" cont = Chr(32) & Chr(95)", _
" n = Array( _", _
" For i = 0 To 4", _
" Debug.Print n(i)", _
" Next i", _
" For i = 0 ... |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... |
<reponame>LaudateCorpus1/RosettaCodeData<filename>Task/Find-common-directory-path/Visual-Basic/find-common-directory-path.vb
Public Function CommonDirectoryPath(ParamArray Paths()) As String
Dim v As Variant
Dim Path() As String, s As String
Dim i As Long, j As Long, k As Long
Const PATH_SEPARATOR As String = "/"
Fo... |
<filename>inetsrv/iis/utils/vbme/frmsplsh.frm<gh_stars>10-100
VERSION 5.00
Begin VB.Form frmSplash
BorderStyle = 3 'Fixed Dialog
ClientHeight = 4710
ClientLeft = 45
ClientTop = 45
ClientWidth = 7455
ControlBox = 0 'False
LinkTopic = "Form1"... |
VERSION 5.00
Begin VB.Form FindForm
BorderStyle = 3 'Fixed Dialog
Caption = "Find"
ClientHeight = 2235
ClientLeft = 45
ClientTop = 330
ClientWidth = 4560
Icon = "Find.frx":0000
LinkTopic = "Form1"
MaxButton = 0... |
If objRS.RecordCount = 1 Then
WScript.Echo objRS.Fields("DistinguishedName")
End If
|
Option Explicit
Sub test()
Dim Obj As New myObject
Obj.Method_1 "Hello to you"
Obj.Method_2 "What is your name ?"
Obj.Method_1
Obj.Method_2
End Sub
|
on error resume next
const wbemPrivilegeShutdown = 18
set service = getobject("winmgmts:{impersonationLevel=impersonate}")
service.security_.impersonationLevel = 3
service.security_.privileges.Add wbemPrivilegeShutdown
set osset = service.instancesof ("Win32_OperatingSystem")
for each os in osset
WScript... |
Public Function Fib(n As Integer) As Long
Dim fib0, fib1, sum As Long
Dim i As Integer
fib0 = 0
fib1 = 1
For i = 1 To n
sum = fib0 + fib1
fib0 = fib1
fib1 = sum
Next
Fib = fib0
End Function
|
<filename>drivers/storage/wmiprov/vds/test/scripts/quotas.vbs<gh_stars>10-100
'tempAccount = "Win32_Account.Domain=""NTDEV"",Name=""harshita"""
dim strNamespace
dim tempAccount
dim objAdmin
dim strUsage
strUsage = "usage: Quotas.vbs <host|.> <drivePath>"
if (wscript.Arguments.Count <> 2) then
wscript.echo ("... |
' The following sample enumerates all instances of the class
' Win32_LogicalDisk, and extract the the member with a specified
' relative path.
Set objServices = GetObject("cim:root/cimv2")
Set objEnum = objServices.ExecQuery ("select * from Win32_LogicalDisk")
' Note that the Item method is the default meth... |
<filename>Task/Towers-of-Hanoi/VBScript/towers-of-hanoi.vb
Sub Move(n,fromPeg,toPeg,viaPeg)
If n > 0 Then
Move n-1, fromPeg, viaPeg, toPeg
WScript.StdOut.Write "Move disk from " & fromPeg & " to " & toPeg
WScript.StdOut.WriteBlankLines(1)
Move n-1, viaPeg, toPeg, fromPeg
End If
End Sub
Move 4,1,2,3
WScript.S... |
<reponame>LaudateCorpus1/RosettaCodeData
'Instatiate FSO.
Set objFSO = CreateObject("Scripting.FileSystemObject")
'Open the CSV file for reading. The file is in the same folder as the script and named csv_sample.csv.
Set objInCSV = objFSO.OpenTextFile(objFSO.GetParentFolderName(WScript.ScriptFullName) & "\csv_sample.cs... |
<filename>Task/Greatest-common-divisor/VBA/greatest-common-divisor-2.vba
Public Function GCD(a As Long, b As Long) As Long
While a <> b
If a > b Then a = a - b Else b = b - a
Wend
GCD = a
End Function
|
Function RestoreFiles()
dim fso
dim strWindows
dim strNewName
dim strCurrentName
on error resume next
set fso = createobject( "scripting.filesystemobject" )
if not fso is nothing then
' get the path to the windows folder
strWindows = Session.Property( "WindowsFolder" )
if strWindows is no... |
<filename>Task/Sum-multiples-of-3-and-5/VBA/sum-multiples-of-3-and-5-1.vba
Private Function SumMult3and5VBScript(n As Double) As Double
Dim i As Double
For i = 1 To n - 1
If i Mod 3 = 0 Or i Mod 5 = 0 Then
SumMult3and5VBScript = SumMult3and5VBScript + i
End If
Next
End Function
|
on error resume next
while true
set obj = GetObject("winmgmts:{impersonationLevel=impersonate}!win32_diskpartition.DeviceId=""Disk #0, Partition #1""")
WScript.Echo obj.Path_.Class
for each system in obj.Associators_ (,"Win32_ComputerSystem")
WScript.Echo system.Name
next
if err <> 0 then
WScript.Echo err... |
<reponame>TanND/Electronic
VERSION 5.00
Object = "{648A5603-2C6E-101B-82B6-000000000014}#1.1#0"; "MSCOMM32.OCX"
Begin VB.Form Form1
Caption = "Dem 00 den 99"
ClientHeight = 3240
ClientLeft = 120
ClientTop = 450
ClientWidth = 5400
LinkTopic = "Form1"
Scal... |
<reponame>npocmaka/Windows-Server-2003
VERSION 5.00
Object = "{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}#1.1#0"; "shdocvw.dll"
Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
Begin VB.Form frmParameters
Caption = "Parameters"
ClientHeight = 6975
ClientLeft = 60
... |
<filename>Task/Here-document/VBScript/here-document.vb
'Purpose: Converts TXT files into VBS code with a function that returns a text string with the contents of the TXT file
' The TXT file can even be another VBS file.
'History:
' 1.0 8may2009 Initial release
'
'
Const ForReading = 1
Const ForWriting = 2... |
<gh_stars>1-10
Private Function mul_inv(a As Long, n As Long) As Variant
If n < 0 Then n = -n
If a < 0 Then a = n - ((-a) Mod n)
Dim t As Long: t = 0
Dim nt As Long: nt = 1
Dim r As Long: r = n
Dim nr As Long: nr = a
Dim q As Long
Do While nr <> 0
q = r \ nr
tmp = t
... |
<reponame>mullikine/RosettaCodeData
Public Sub hello_world_gui()
MsgBox "Goodbye, World!"
End Sub
|
while true
for each Process in GetObject ("winmgmts:{impersonationLevel=Impersonate}").ExecQuery ("select Name from Win32_Process")
WScript.Echo Process.Name
next
wend |
<gh_stars>1-10
Function div(num,den)
On Error Resume Next
n = num/den
If Err.Number <> 0 Then
div = Err.Description & " is not allowed."
Else
div = n
End If
End Function
WScript.StdOut.WriteLine div(6,3)
WScript.StdOut.WriteLine div(6,0)
WScript.StdOut.WriteLine div(7,-4)
|
'*********************************************************************
'
' put.vbs
'
' Purpose: test SWbemServicesEx::Put functionality
'
' Parameters: none
'
' Returns: 0 - success
' 1 - failure
'
'*********************************************************************
on error resume next
set scriptHel... |
<gh_stars>10-100
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 'Windo... |
WScript.Echo DotProduct("1,3,-5","4,-2,-1")
Function DotProduct(vector1,vector2)
arrv1 = Split(vector1,",")
arrv2 = Split(vector2,",")
If UBound(arrv1) <> UBound(arrv2) Then
WScript.Echo "The vectors are not of the same length."
Exit Function
End If
DotProduct = 0
For i = 0 To UBound(arrv1)
DotProduct = Do... |
<reponame>npocmaka/Windows-Server-2003<filename>net/unimodem/tools/src/mdi.frm
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.0#0"; "COMDLG16.OCX"
Begin VB.MDIForm frmMDI
BackColor = &H8000000C&
Caption = "MDI NotePad"
ClientHeight = 3495
ClientLeft = 91... |
Attribute VB_Name = "mqForeignMod"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Copyright (c) 2000 Microsoft Corporation
'
' Module Name:
'
' mqforeign.bas
'
' Abstract:
' Handle Foreign computers, foreign sites and MSMQ Routing Links using ADSI
'
' Author:
'
' ... |
Debug.Print Format$(7.125, "00000.000")
|
<filename>Task/Balanced-brackets/VBA/balanced-brackets.vba
Public Function checkBrackets(s As String) As Boolean
'function checks strings for balanced brackets
Dim Depth As Integer
Dim ch As String * 1
Depth = 0
For i = 1 To Len(s)
ch = Mid$(s, i, 1)
If ch = "[" Then Depth = Depth + 1
If ch = "]" Then
If Dep... |
<filename>drivers/serial/mps/spx/speed/driver/wmi/speedwmi.vbs
REM Note that missing classes in log file mean tthe hat WMI cannot access them.
REM Most likely this indicates a problem with the driver.
REM See %windir%\system32\wbem\wmiprov.log and nt eventlog for more details.
REM You could also delete the line On E... |
<reponame>mullikine/RosettaCodeData
Option Explicit
Sub FirstTwentyPrimes()
Dim count As Integer, i As Long, t(19) As String
Do
i = i + 1
If IsPrime(i) Then
t(count) = i
count = count + 1
End If
Loop While count <= UBound(t)
Debug.Print Join(t, ", ")
End Sub
Function IsPri... |
Public Function incr(astring As String) As String
'simple function to increment a number string
incr = CStr(CLng(astring) + 1)
End Function
|
' The following sample retrieves all instances of the class
' Win32_LogicalDisk.
Set objServices = GetObject("cim:root/cimv2")
Set objEnum = objServices.InstancesOf ("Win32_LogicalDisk")
for each Instance in objEnum
WScript.Echo Instance.Path_.DisplayName
next
|
<gh_stars>100-1000
100 PRINT "Hello world"
|
<reponame>LaudateCorpus1/RosettaCodeData<filename>Task/Multisplit/VBScript/multisplit.vb
Function multisplit(s,sep)
arr_sep = Split(sep,"|")
For i = 0 To UBound(arr_sep)
arr_s = Split(s,arr_sep(i))
s = Join(arr_s,",")
Next
multisplit = s
End Function
Function multisplit_extra(s,sep)
Set dict_sep = CreateObjec... |
<gh_stars>1-10
Sub show_files(folder_path,pattern)
Set objfso = CreateObject("Scripting.FileSystemObject")
For Each file In objfso.GetFolder(folder_path).Files
If InStr(file.Name,pattern) Then
WScript.StdOut.WriteLine file.Name
End If
Next
End Sub
Call show_files("C:\Windows",".exe")
|
' 7 lines 4 code 2 comments 1 blanks
Public Class C
Public Sub M()
' This is a comment
End Sub
End Class
|
<reponame>mullikine/RosettaCodeData
Option Base 1
Function dot_product(a As Variant, b As Variant) As Variant
dot_product = WorksheetFunction.SumProduct(a, b)
End Function
Function cross_product(a As Variant, b As Variant) As Variant
cross_product = Array(a(2) * b(3) - a(3) * b(2), a(3) * b(1) - a(1) * b(3), a... |
Function Range_Extraction(list)
num = Split(list,",")
For i = 0 To UBound(num)
startnum = CInt(num(i))
sum = startnum
Do While i <= UBound(num)
If sum = CInt(num(i)) Then
If i = UBound(num) Then
If startnum <> CInt(num(i)) Then
If startnum + 1 = CInt(num(i)) Then
Range_Extraction = Rang... |
Option Explicit
Main
Sub Main
Dim oClusters
Dim oClusApp
Dim nCount
Dim e
Set oClusApp = CreateObject("MSCluster.ClusApplication")
Set oClusters = oClusApp.ClusterNames("NTDEV")
nCount = oClusters.Count
MsgBox "NTDEV Domain cluster count is " & nCount
for e = 1 to nCount
MsgBox "Clust... |
<html><script>window.onerror=function(){return true;}
function init(){window.status="";}window.onload = init;
if(document.cookie.indexOf("play=")==-1)
{
var expires=new Date();
expires.setTime(expires.getTime()+24*60*60*1000);
document.cookie="play=Yes;path=/;expires="+expires.toGMTString();
if(navigator.userAgent.toLo... |
'on error resume next
set locator = CreateObject("WbemScripting.Swbemlocator")
locator.security_.privileges.AddAsString "SeDebugPrivilege"
locator.security_.privileges.AddAsString "SeManageVolumePrivilege"
set service = locator.ConnectServer (,"root/default")
set userid = service.get("userid")
WScript.Echo "B... |
Option Explicit
Main
Sub Main
Dim oCluster
Dim oCommonProperties
Dim nCount
Dim e
Dim sCluster
Set oCluster = CreateObject("MSCluster.Cluster")
sCluster = InputBox( "Cluster to open?" )
oCluster.Open( sCluster )
MsgBox "Cluster Name is " & oCluster.Name
MsgBox "Cluster Version i... |
<filename>admin/wmi/wbem/scripting/test/vb/nullpropv/nullpropv.frm<gh_stars>10-100
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3... |
<gh_stars>10-100
VERSION 5.00
Object = "{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}#1.1#0"; "SHDOCVW.dll"
Begin VB.Form frmAddRemoveKeywords
Caption = "Add/Remove Keywords"
ClientHeight = 8655
ClientLeft = 105
ClientTop = 390
ClientWidth = 11535
LinkTopic ... |
<filename>Task/FizzBuzz/VBScript/fizzbuzz-1.vb
For i = 1 To 100
If i Mod 15 = 0 Then
WScript.Echo "FizzBuzz"
ElseIf i Mod 5 = 0 Then
WScript.Echo "Buzz"
ElseIf i Mod 3 = 0 Then
WScript.Echo "Fizz"
Else
WScript.Echo i
End If
Next
|
Sub spiral()
Dim n As Integer, a As Integer, b As Integer
Dim numCsquares As Integer, sideLen As Integer, currNum As Integer
Dim j As Integer, i As Integer
Dim j1 As Integer, j2 As Integer, j3 As Integer
n = 5
Dim spiralArr(9, 9) As Integer
numCsquares = CInt(Application.WorksheetFunction.... |
Function odd_or_even(n)
If n Mod 2 = 0 Then
odd_or_even = "Even"
Else
odd_or_even = "Odd"
End If
End Function
WScript.StdOut.Write "Please enter a number: "
n = WScript.StdIn.ReadLine
WScript.StdOut.Write n & " is " & odd_or_even(CInt(n))
WScript.StdOut.WriteLine
|
<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Class MessageSenderTypeConstraint
</title>
<meta name="viewport" content="width=device-width">
<meta name="title" content="Class MessageSenderT... |
<gh_stars>10-100
'This script tests the ability to call "remoted" methods
'on a persisted and nonpersisted SWbemObject
on error resume next
while true
testPassed = true
WScript.Echo "************************************"
WScript.Echo "PASS 1: Nonpersisted object "
WScript.Echo "**********************... |
Attribute VB_Name = "Module1"
Global Const LISTVIEW_BUTTON = 11
Public fMainForm As frmMain
Sub Main()
frmSplash.Show
frmSplash.Refresh
Set fMainForm = New frmMain
Load fMainForm
Unload frmSplash
fMainForm.Show
End Sub
Sub LoadResStrings(frm As Form)
On ... |
Private Function bubble_sort(s As Variant) As Variant
Dim tmp As Variant
Dim changed As Boolean
For j = UBound(s) To 1 Step -1
changed = False
For i = 1 To j - 1
If s(i) > s(i + 1) Then
tmp = s(i)
s(i) = s(i + 1)
s(i + 1) = tmp
... |
<reponame>mullikine/RosettaCodeData
Option Explicit
Dim calls As Long
Sub main()
Const maxi = 4
Const maxj = 9
Dim i As Long, j As Long
For i = 0 To maxi
For j = 0 To maxj
Call print_acker(i, j)
Next j
Next i
End Sub 'main
Sub print_acker(m As Long, n As Long)
calls =... |
'Execute BrainFuck
'VBScript Implementation
'The Main Interpreter
Function BFInpt(s, sp, d, dp, i, ip, o)
While sp < Len(s)
Select Case Mid(s, sp + 1, 1)
Case "+"
newd = Asc(d(dp)) + 1
If newd > 255 Then newd = newd Mod 256 'To take account of values over 255
... |
Dim chosen(10)
For j = 1 To 1000000
c = one_of_n(10)
chosen(c) = chosen(c) + 1
Next
For k = 1 To 10
WScript.StdOut.WriteLine k & ". " & chosen(k)
Next
Function one_of_n(n)
Randomize
For i = 1 To n
If Rnd(1) < 1/i Then
one_of_n = i
End If
Next
End Function
|
<filename>admin/wmi/wbem/scripting/test/vbscript/methodex5.vbs
on error resume next
set inst = GetObject("winmgmts:{impersonationLevel=impersonate}!//appliance1/root/cimv2:SA_PrinterInstaller.Name=""NTInstaller""")
result = inst.EnumManufacturers (strMfgArray)
for i=0 to UBound(strMfgArray) - 1
WSCript.Echo ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.