How To Kill And Restart A .exe File
Jan 22, 2009Public Function RsReDir()
'function to restart dns redirector - working as of 12-11-08'
Dim plist As Process() = Process.GetProcesses()
[code].....
Public Function RsReDir()
'function to restart dns redirector - working as of 12-11-08'
Dim plist As Process() = Process.GetProcesses()
[code].....
Public Function RsReDir() 'function to restart dns redirector - working as of 12-11-08'
Dim plist As Process() = Process.GetProcesses() 'Get and parse list of processes to plist'
For Each p As Process In plist 'parse each entry in plist as p process'
Try
If p.MainModule.ModuleName.ToLower() = "dnsredir.exe" Then p.Kill() 'If module name of process matches "dnsredir.exe" then kill p'
Catch
[code]....
i would like to kill and restart dnsredir.exe file but the code doesnt' seem to work?
I have some old VBscript code to kill a windows process but am having trouble gettign it working. here is the code
[Code]...
Is there any way we can kill a driver (.sys file)?
View 10 RepliesI am making an updater that downloads some files from a webservice and copies them to a directory, overwriting old files.
It works ok, but what if a user for whatever reason has opened a file. It will throw an error, because the file is in use.
Is there a way to determine which process is using the file? Then I will be able to kill it.
If I want to abort or end this operation, myprocess.kill() does not work I'm thinking that the Cmd box gets killed but tsmuxer remains alive to fight another day.
myapp= joinstreams.cmd which is C:\tsmuxer.exe "C:\workSeamM2TS.meta" "C:\workSeamM2TS.m2ts"
Dim myProcess As New Process()
myProcess.StartInfo.WorkingDirectory = Application.StartupPath[code].....
I would like to write a sub routine to kill an executable file called 'dfsvc.exe'. I'll call this subroutine when I exit my application to kill this file. When I exit my application this file is still running and takes around 15 minutes before it disappears. I would like to kill it to remove the delay.. The following code below doesnt work..
[Code]...
I have a start and stop button on a form and would like a pause and restart button aswell.
I can start my audio file (WAV file in the C-Drive) fine with;
My.Computer.Audio.Play("C:Bleep_TestBleep_Test.wav", AudioPlayMode.Background)
Thus allowing other functions to be carried out.I can stop my audio with;
My.Computer.Audio.Stop()
But i would like to be able to pause and restart the audio?There are timers and getkeystates envolved with this form. The timers I can pause and restart, the getkeystates are a function called in conjunction with the timers as a case statement, (all this is working).how to pause and restart the audio, bearing in mind the loaction and the other features of the form? (I only wish i was a clever as you guys/girls out there to return the help rather than leaching your knowledge continously)
I am writing a simple program that I'm going to use to end a process and then delete a folder with its contents but, I am running into some errors when I try to delete an .dll file using Kill. I would have figured this out on my own but its being weird.
1. If I run the .exe it doesn't delete it and gives me and error
2. I i run the .exe as administrator it doesn't delete it and gives me an error
3. If I run visual basic 2008 as Administrator and then execute the program it works.
4. If I try and execute it again as Administrator under Visual Basic it doesn't work and says I don't have sufficient access.
What I am trying to do is End a Process so that I am able to delete the folder, the folder contains and .dll which is being stuborn and saying I don't have sufficient access to do this.
Kill
Public Class Form1
Public Sub killprocess(ByRef strproccesstokill As String)
Dim proc() As Process = Process.GetProcesses
[CODE]...
My app is designed to work on XP & Vista but I get an error on Vista but not XP When I want to kill/delete or move a file from an external drive I get an external error message System.UnauthorizedAccessException: Access to the path is denied.
full error text:
************** Exception Text **************
System.UnauthorizedAccessException: Access to the path is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
[code]....
In an app I am writing I need to be able to display the current settings of the following:- Windows "automatically restart on error" setting from advanced, startup and recovery section Paging file size and whether it is custom size or set to system managed Is this at all possible? perhaps VB has a function to do so I cannot find, or perhaps I can do by querying a registry value?
View 6 RepliesHow can i restart the a frm?
View 4 RepliesIf I had a command button and I wanted it to shutdown or restart there computer when they want to.can I just use a simple shell command?
View 2 RepliesThis is what i have so far, but i just wanted to how to execute this on a remote pc.[code]
View 5 RepliesI'm new to VB.NET and trying to write a program that prompts the user for a server name and then restarts the IIS on that machine. [code]
View 1 RepliesMy applicaiton has several forms with textboxes. I need to make Save settings button and Load settings button. I have module that stores a lot of variables. Saving these variables was easy. Now i want to load these settings. In each form_load event is written code, which fill textboxes with variables from module file, also some forms create databases which are defined in module file..
View 2 RepliesIs there any code I can put in my VB.NET application that restarts someone computer when it runs? No external EXEs or DLLs.
View 3 RepliesAm having a problem with session id. I wanna know if it is possible to restart the session id with vb.net... lets say...enter a web application and my
[Code]...
Is there a way to restart a windows application written in dot net using dot net code
I mean the application should exit and restart itself, on click of a button
I am making a program that takes a time input from the user or a countdown amount and when that time comes it will shutdown or restart or log off the computer. I know how to make the timing code and everything else but i don't know how to shutdown or restart or log off.
View 1 RepliesI dont know use application.restart() in vb.net i dont found this command
View 2 RepliesI have a database with a simple table (userid, username). The userid field is int and autoincrement is set to true. When I add 2 records to the table, the user id will be 1, 2.
View 5 RepliesIs this the way to restart bw after timer has counted down?
Timer1.Interval = 30000 '30sec
Dim timercountdown As Double = Timer1.Interval / 1000
ToolStripStatusLabel2.Text = Nothing[code]....
I would like to know if it's possible to stop | start | restart service as a User with a vb program?
The reason is that for some reason, I have to restart some service for a special application on certain station but the people who use them are log on as Admin and I can't go there each time or use vnc.
Is it possible to create a webform that can restart the windows services of an IIS server?
View 4 RepliesHow do I restart an installed SQL Server service? I've used that code for this, but it didn't worked. I think it won't find the exact service name. So it doesn't work.
[Code]...
I'm trying to restart Word from within vba code.I've written code to change the startup path and want to restart to take effect.I do this by:
Call Shell (Application.Path & Application.PathSeparator & "WINWORD.EXE")
Application.Quit
this seems to work.my questions are:Is this save?Is there a way to extract the executable name from the Application object? so I don't have to rely on the name being "winword.exe" Application.Name gives me "Microsoft Word", not the exe name.
I'm using my.settings to store different communication parameters. After changing parameters, for several reasons, it's easier to restart the application then to re-initialize all objects/variables/etc using program code.
When I change my.settings and use save to save them. When I quit the application and manually start it again, the newly saved settings are used.
When I use either .restart, or application.exit in combination with process.start. The application will use the old values for my.settings.
If I read up on .restart there's a remark mentioning that it will restart the application using the initially used settings.
Before restarting the application, I manually checked if the new settings were really save to the user.config file, and they were.
My question: Is there a way to restart the application using either .restart, or application.exit in combination with process.start which will use the newly saved my.settings values?
I'm trying to create a way for the User of my application to Log Off, Shutdown, or Restart the PC.
The idea is that User can more quickly access these options from my application and if they choose, force these actions instead of waiting for the OS to respond.
Here's how I'm trying to do it:
CODE:
Log Off works just fine. It's shutdown and restart that doesn't work. From the research that I've done, the Consts seem fine and the function obviously works correctly because Log Off works. I am running the application as an administrator, so that should affect it.
I'm trying to have my web browser simulate the reloading of the webpage without having to refresh the page. For example, if a user loads a web page, then they lose internet connection and they want to refresh the page they could just click a button to reload all the contents of the webpage including scripts to their original settings.
View 2 Replies