![]() |
kiranreddys.com free software for you |
|
Private Sub Form_Load()
'getting screen resolution with GetSystemMetrics
MsgBox "Current Screen Resolution is " &
GetSystemMetrics(SM_CXSCREEN) & " x " & GetSystemMetrics(SM_CYSCREEN)
' Or you can use below
'best way is using Screen.TwipsPerPixel
MsgBox "Current Screen Resolution is " &
Screen.Width / Screen.TwipsPerPixelX & " x " & Screen.Height
/ Screen.TwipsPerPixelY
End Sub
'Code by Kiran
'Running DOS Batch File with Shell using vbscript
through VBS script
'You can run Batch file from Visual Basic Exe or with siple text file called
VBS file
'Type below code in note pad and save it with .VBS extension,
'Once you double click this it aoutomatically exicutes the DO Batch file
Set oShell = CreateObject("WSCript.shell")
sCmd = "C:\yourbatchfile.bat"
' If you have spaces in the path, you can do like this
instead:
'sCmd = Chr(34) & "j:\yourbatchfile.bat"
& Chr(34) 'commented
' The 0 will make it run hidden
oShell.Run sCmd, 0, False
' The 7 will make it run minimized
'oShell.Run sCmd, 7, False 'commented