Tags » VBScript

Working with DOS Command Line

Working with DOS Command Line

in short: command-line window can be identified with programmatic description

Window( "object class:=ConsoleWindowClass" )

Execute VBScript from C#

This can be done using, CScript.exe

Process scriptProc = new Process();
scriptProc.StartInfo.FileName = @"cscript"; 
scriptProc.StartInfo.WorkingDirectory = @"c:\scripts\";
scriptProc.StartInfo.Arguments ="//B //Nologo vbscript.vbs";
scriptProc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; //prevents console window from popping out
scriptProc.Start();
scriptProc.WaitForExit(); //(Optional)
scriptProc.Close();
C#

VB Script to see the IP Address of the System

For Private IP , copy the following code on Notepad and save as IPaddress.vbs

============================================================

strcomputer = “.”
Set objWMIService = GetObject(“winmgmts:” _
& “{impersonationLevel=impersonate}!\\” & strComputer & “\root\cimv2”) 73 more words

Tips & Tricks

Script to prevent auto-locking of a Windows Machine

Yesterday I was working on a windows machine which was getting auto locked in a very short delay. If you are facing the same problem, you can write… 27 more words

VBScript

HTA : A GUI for VBScript

I am working and tired of clicking scripts. I am tired of double-clicking scripts in order for it to run. I am tired of running it via command line. 308 more words

GUI

How to get a cell value in WinListView object

Use the method GetSubItem.

GetSubItem row, column
Rows and columns are zero based.
So getting the first row, second column is
getsubitem 0,1

VBScript - Append To File

Set objFSO = CreateObject(“Scripting.FileSystemObject”)
Const FOR_APPENDING = 8

‘#####################################
‘ Sub to add string to data file
‘ Input: File name, string to be added… 47 more words

Scripting