Use The Wscript.Shell Properties In .Net?

Apr 21, 2009

How can i use the Wscript.Shell properties in .Net?

Foe eg,
Set objShell = Wscript.CreateObject("Wscript.Shell")
or
Set objNetwork = CreateObject("Wscript.Network")
objNetwork.MapNetworkDrive "X:", "\atl-fs-01public"

When i use the same in Vb.net, i'm getting errors? Is there any namespace for that? How can i overcome the Error and use the same in Vb.net?

View 2 Replies


ADVERTISEMENT

CreateObject("WScript.Shell") With Cmd Window Minimized?

Nov 2, 2009

I using visual studio 2008 and visual basic.I need to create a form that pings my companies servers and gets the return value of the ping and displays the results in a label and run with a timer. I have eveything pretty set up and working the way I want it to but I would the command window pops up when the command is run. I found some code that was supposed to keep the command window in the background but it doesn't seem to work. [b]Can ayone help me figure how to make the command window run in the background or at least keeping if from popping up?/B]This is the code I found. According to the article I read False should keep the command window minimized. I tried it with true and I also tried it with False and neither worked.

objCmd = objWShell.Exec("ping " & url, 0, False)

This is the actual code I'm trying to run.

Public Function fnPingmeVer3(ByVal url As String) As String
Dim StringReturn As String
Dim objWShell As Object = New Object

[code]....

View 8 Replies

"WScript.Shell" Equivalent In .NET?

Jun 15, 2011

i was wondering if there exists an equivalent statement in asp.net/vb.net for

Set objShell = CreateObject("WScript.Shell")

and can we then call something like this objShell.run "msiexec /i http://abc.com/asd.msi /passive",1 , True What are the thoughts about achieving the same thing in vb.net?

View 6 Replies

Cscript/wscript File To Run Program?

Mar 17, 2012

I'm in need of vbscript file. I'm planning to run something like "wscript.exe Psexec.vbs" on a WHS 2003.

I've come up with the following but my server doesn't like it Line1: Set Command = WScript.CreateObject("WScript.Shell")

Line2: cmd = "c:windowssystem32Psexec.exe \192.168.0.xx -i -h -d -u Administrator -p Password "c:program filesInternet Exploreriexplore.exe" "http://192.168.0.xx/mControl/Editor.aspx#/PageCameras""

Line3: Command.Run (cmd) The Psexec code in Line2 works fine at the command prompt, but I don't know how to get it into a vbscript file.

View 9 Replies

VS 2008 Make A Shell Replacement For The Windows Default Shell

Aug 1, 2009

I'm going to attempt to make a shell replacement for the Windows default shell: explorer.exe. I'm not sure if its possible using Vb.Net, but I can't seem why not. My end goal is to use a custom made shell for a Windows Preinstallation Environment instead of the default command prompt. I plan to use a 3rd party program to compile the program with the .NET Framework. Otherwise, it wouldn't work because Windows PE does not support the .NET Framework.

View 1 Replies

Use Shell To Have Application Call An External Application But Its Not Working - Error: 'System.windows.shell'

Jun 3, 2011

I'm trying to use the Shell to have my application call an external application but its not working...I don't understand why. I get the following error: 'System.windows.shell' is a namespace and cannot be used as an expression!

Heres my code....any ideas what I'm doing wrong. Its got to be a simple...stupid error.

Private Sub mnuUpgrade_Click(ByVal Ctrl As Microsoft.Expression.Web.Interop.Legacy.CommandBarButton, ByRef CancelDefault As Boolean) Handles mnuUpgrade.Click

[CODE].....................

View 2 Replies

When Run Script, The Error Appear"Object Required: 'wscript'"?

Aug 15, 2011

My codes is the following: Set WshShell = CreateObject("WScript.Shell")

WshShell.Run "calc"
WScript.Sleep 100
WshShell.AppActivate "Calculator"[code]....

When run to the step "WScript.Sleep 100", the error will appear "Object required:'wscript'". I don't know why the error appear,

View 3 Replies

Make Custom Properties In Properties Window To Refresh Upon Change Via Code?

Apr 26, 2012

[code]I want to make the Properties Window to update the properties for X and Y at each MouseMove, so they become immediately visible for the user.

View 2 Replies

User Control Properties - Finalize My Design Time Properties Grid

Apr 27, 2011

I'm making a control and I am trying to finalize my design time properties grid. I have several List(of Class) items as public properties and when I click on the design time menu (while testing the control) there is the word "Collection" and a button with an ellipsis (...) that brings up a neat pop up with the buttons Add/remove and all of the public properties of the collection's class on the right hand side. Basically for a non-collection instance of a class (with public properties) I'd like a similar button to show up. I know I could put all of the properties in the main control class and group them, but I like the pop up box feature. Anyway to duplicate this? (think font grid item etc.)

View 3 Replies

VS 2010 Express - PictureBox Design Properties Box Shows Properties That Cannot Be Accessed?

Mar 5, 2012

In the form design I set up a TableLayoutPanel, 20x20 cells and in cell (1,1) a PictureBox (called Target) containing the image of a small target. The properties box for Target shows some very promising properties, Column and Row - and if you overwrite the values in the properties box, the PictureBox obligingly shifts to the corresponding cell position in th design. However in VB it is not possible to refer to Me.Target.Row or .Column - neither appears during coding in the menu of properties, and deliberately coding either of them produces an error like

Error 1 'row' is not a member of 'System.Windows.Forms.PictureBox'.

1. Why does the properties box show properties that cannot be altered programmatically?

2. How can my program move Target around in the TableLayoutPanel?

View 10 Replies

Expose A UserControl's Properties To Properties Window In Designer?

Aug 19, 2009

Is there a way to expose a UserControl's properties to the Properties Window in the Designer?

View 3 Replies

Set The Transparent Property Via Label Properties Properties Not Via Code?

Jan 16, 2009

I'm working on a Hazardous Materials label printing program. One of the options is to do an "NFPA" label. Since there are 4 values required with 4 or 6 options, the ratings are entered via radio buttons in a group box. That's working okay. I display values in the NFPA diamond as they're entered: left quadrant blue, top quadrant red, left yellow, bottom red. I'm having trouble with the label in which the rating will be displayed on top of a jpg diamond for the white. In this quadrant the text can be up to 4 characters. I can accept the text going into an adjacent block a little, but the corners of the label overlap into another quadrant/color. I reduced the font size which solved the overlap problem but the font is then too small and looks terrible. I tried to make the background of the label transparent to let the color come through correctly but that's not a valid value for label.background. I'm figuring that the transparent background is the best solution. What can I use that will accept a transparent background so the color shows through?

I'm trying to set the transparent property via label properties properties, not via code. Here's the code if it makes any difference:

Public Class NFPA
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Close()
End Sub

[code]....

View 2 Replies

Change All Properties Of A Form To Properties Of Other But Don't Change Important Properties?

Feb 26, 2011

How to change all properties of a form to properties of other but don't change important properties like Owner,Handle, OwnedForms, Parent,HasChildren,Controls and ... .I have a child form that i want it to provide controls of Form.The background form provides Aero frame and child form is a transparent form in it.I want it because I want to draw buttons with system style in Aero in Windows Forms.This is my own code but it does not work good (ForeForm is child form):

For Each Propertry In ForeForm.GetType.GetProperties()
Select Case Propertry.Name
Case "AeroBackgroundEnabled", "FormBorderStyle", "TransparencyKey", "Parent", "Owner", "ShowInTaskbar", "Handle", "HasChildren", "OwnedFo[code].....

Additionaly:I wrote a great Aero Form.I don't publish current version (1.2) that supports Aero Blur,RealTime Aero Color change,extend Basic theme?

View 13 Replies

Adding "Properties" Dialogs - Pre-built Dialog Or Control For Displaying Properties At Runtime?

Nov 6, 2008

I have my own class of graphic objects, and now I'd like to allow a user to right-click on one of those within the application and see a properties window. Is there a pre-built dialog or control for displaying properties at runtime? I'd like to have something just like the IDE properties window button for my application.

View 4 Replies

PictureBox Properties In PRintDocument Did Not Contain The Properties Set?

Mar 27, 2012

Public Class LOA
Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage

[code].....

View 3 Replies

Get Custom Properties For A Custom Control Into The Visual Studio Properties List?

Nov 25, 2009

What I've done is create a User Control Library (Project) and I've added a single User Control to that project. The control contains a single FlowLayoutPanel, and I created a Property on the control itself to pass the FlowDirection from the Control to its FlowLayoutPanel child.

Build, reference, component appears in the Toolbox and everything works fine, but the property on the control does not appear in the Properties window when I go to edit it at design time.

View 6 Replies

Bat File To Run In Exe (like Shell)?

Apr 17, 2011

i have this

Quote:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Process.Start("mybatchfile.bat")
End Sub

its working if they are on the same folder,i want to do is make the batch file as a resource file so that i can run it even not in the batchs folder?

View 9 Replies

Launching A .lnk Using Shell

Jul 26, 2010

I can create a shortcut using this code:

Dim sFolder As String, sTarget As String, sAppName As String
Dim oShell As New WshShell
Dim oShortcut As WshShortcut

[Code]....

View 5 Replies

Regarding Unzip Using Shell Dll?

Apr 17, 2009

I am using Shell Dll to unzip zip file in vb.net 2005. Following is the code for this.

Dim sc As Shell32.Shell = New Shell32.Shell
Dim srcf As Shell32.Folder = sc.NameSpace(src)
Dim desf As Shell32.Folder = sc.NameSpace(des)

[code].....

View 2 Replies

Run Msg.exe After Opening A Shell Using Cmd.exe?

Jun 26, 2012

I want to send messages withing a windows 7 LAN using VB.NET code. The problem is that the msg.exe executes commands in admin mode only. Here is the code. Shell("cmd.exe /k runas /user:farook-pcadministrator msg.exe") 'Here i'm prompted for a password. Shell("cmd.exe /k msg.exe", 1) I use the /k switch to see what's going on in the shell. /c is the silent switch. I do not wish to use runas neither do I wish to change privilages in msg.exe

View 2 Replies

Run Shell() As Administrator?

Nov 14, 2009

I have an update app, which can be updated itself by another update app (so, the second app is an updater of the main updater). Both apps must have administrator permissions because of writing in the Program Files folder. Is it possible that when the main updater is running (under administrator rights) it can use Shell() to let the second updater run with administrator rights without a UAC confirm dialog popping up again?

View 3 Replies

Start Instead Of Shell?

Aug 10, 2010

it possible to have a start command instead of the simple shell the same code as in a .BAT File, i dont know but on a .bat is a higher/lower lvl.

[Code]...

View 11 Replies

Using Shell And Getting Feedback?

Oct 18, 2011

I want to be able to run any command by typing into a textbox.For example if I wanted to get info from "ipconfig".I want to be able to type "ipconfig" into the textbox and for it to then display the infomation into a richtextbox.I have been searching the internet but so far can not find a solution

Code:
Shell("ipconfig", AppWinStyle.Hide)

How do I now display the infomation from the console into a richtextbox?

View 3 Replies

Using Shell Function In .Net?

Dec 26, 2007

I want to use Shell function in Vb.Net.Thing is that i have 5 checkboxes. on checking each checkbox i want to execute batch file which fires some commands in database.but while checking all 5 checkboxes all batch file gets executed and then it gives me error.I want to run only one batch file at a time.

View 11 Replies

AccessViolationException With Shell To Explorer

Dec 15, 2010

I wrote a backup utility that synchronizes a list of folders. Errors appear in a list. In the list I can right-click to retry, exclude the folder next time, or open the folder in explorer to examine.When I shell to explorer I get an AccessViolationException. Form1 opens Form4 with Form4. ShowDialog(), and that's where the error occurs. The error does not occur within Form4 where the shell function is called. memory must be getting trashed somehow.I've used two methods, Shell and System.Diagnostics.Process.Start. Each produces similar results. Shell waits awhile before causing the error, but Process.Start causes the error immediately.This is VB.Net 2010 using framework 4, though I did resolve a shell problem once before with VBA by writing out a VBScript file then shelling to the VBScript file.

View 3 Replies

AccessViolationException With Shell To Explorer?

Dec 15, 2010

I wrote a backup utility that synchronizes a list of folders. Errors appear in a list. In the list I can right-click to retry, exclude the folder next time, or open the folder in explorer to examine.

When I shell to explorer I get an AccessViolationException. Form1 opens Form4 with Form4.ShowDialog(), and that's where the error occurs. The error does not occur within Form4 where the shell function is called. Memory must be getting trashed somehow.I've used two methods, Shell and System.Diagnostics.Process.Start. Each produces similar results. Shell waits awhile before causing the error, but Process.Start causes the error immediately.

This is VB.Net 2010 using framework 4, though I did resolve a shell problem once before with VBA by writing out a VBScript file then shelling to the VBScript file. I don't think the process being started is isolated enough. It's sharing memory or something else.

View 5 Replies

Add An Icon To Shell Handlers?

Apr 30, 2008

set the Icon for an item in a shell handler? I've set a contextmenu handler to the extension .savdata and added the text "Open with ConvertFile" to the handler so that the context menu for .savdata looks like this:

Open with ConvertFile
-------------------------------------
Send To >

[code]....

So how can I use "my.computer.registry.HKEY_CLASSES_ROOT" in VB 2008 express edition to add an Icon file path to the left of the context menu handler?

View 7 Replies

Add-on To Write Shell Extension?

Nov 15, 2011

Apparently, it's not safe to use the .Net framework < 4 to write a shell extension.

As my users are likely to not have that version of the framework, I'd rather use a third-party solution so I can write the main app in .Net 2 or 3.

Can someone recommend an add-on for this, either open-source or affordable?

View 1 Replies

Can't Shell To Open A Zip File

May 18, 2012

I'm just getting started in VB.net using vb.net 2010 . I thought what I had left to do today was simple but not to be.I am simply trying to open a zip file that the user has selected.No mater how I have tried to send the filename (with quotes added, chr(34) & selfilename, set permissions, confirm file is found) I get Error 53 File Not Found.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim SelFileName As String
Dim ReturnValue As Boolean
SelFileName = ListBox1.SelectedItem 'Contains the full path and filename

[code].....

View 4 Replies

Executing A File In Shell?

Jan 23, 2009

Here's an example code so you can understand my problem:

Dim test1 As String
Dim test2 As String
Dim test3 As String

[code]....

shell.Run("""testProgram""test1 test2 test3 test4") 'I know this is wrong.My problem is in the last line. I want the contents of the strings to be printed, not the names of the strings, and I don't know how to do that.

View 5 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved