Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

VB.NET Shell command


ghost's Avatar
0 0

I don't want your opinion on VB/VB.net. I don't want you to reccommend me use another language. I don't want people posting garbage about C++.

I need to execute a shell command with vb. I have looked up and found the shell command which doesn't work for me.

Eg

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Shell("C:\Documents and Settings\Admin\Local Settings\Application Data\Temporary Projects\file.ext")
    End Sub

It doesn't run/open the file.

Sorry if I havent made myself clear, if needed I will try and expand a bit more.

Any help or links that I have failed to stumble accross will be very appreciated.

Thanks

[edit: disabled smileys]


ghost's Avatar
0 0

Capital D in documents, think that is it, just a path error. :ninja: :D

0rijin4l


ghost's Avatar
0 0

not sure if its this way in vb.net, but in other langs you need to double slash since thats a return char. i.e C:\\Documents and Settingsā€¦..


ghost's Avatar
0 0

slaps head

Thanks - will give it a shot now.