Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

Need help running a silent CMD command (Shell is not working)

Alright I need when a button is pressed it runs the commands "start <application.exe> <IP> <Port>"

However I want it to run silently. When I try opening CMD and inputting the command, it goes through however it opens the window (I tried using taskkill afterwards but I would highly prefer it being 100% silent).

When I try using Shell it make the defualt directory system32 so when it runs the "start <Application.exe> <IP> <Port>" it cannot find the specified application.

Is there anyway to get shell to read from the current directory?
PHP Code

<?php 
Dim processStartInfo 
As ProcessStartInfo = New ProcessStartInfo()
processStartInfo.FileName = "app.exe"
processStartInfo.Arguments = "/k <IP> <Port>"
processStartInfo.WindowStyle = ProcessWindowStyle.Hidden
processStartInfo
.UseShellExecute = True
Process
.Start(processStartInfo) 

This should work!
(Jan 23, 2015 12:04 PM)Zyklon A Wrote:  
PHP Code

<?php 
Dim processStartInfo 
As ProcessStartInfo = New ProcessStartInfo()
processStartInfo.FileName = "app.exe"
processStartInfo.Arguments = "/k <IP> <Port>"
processStartInfo.WindowStyle = ProcessWindowStyle.Hidden
processStartInfo
.UseShellExecute = True
Process
.Start(processStartInfo) 

This should work!

The application needs to be run with the Args. Or I'll get an error since once the application initializes it ignores the cmd args
Like this?

[Image: k1uvf6T.gif]

Code:
Code
Dim p As New ProcessStartInfo("C:\Users\Odus\Desktop\VBConsole.exe", "hello") 'With {.WindowStyle = ProcessWindowStyle.Hidden, .CreateNoWindow = True}
Process.Start(p)
(Jan 23, 2015 01:43 PM)Odus Wrote:  Like this?

[Image: k1uvf6T.gif]

Code:
Code
Dim p As New ProcessStartInfo("C:\Users\Odus\Desktop\VBConsole.exe", "hello") 'With {.WindowStyle = ProcessWindowStyle.Hidden, .CreateNoWindow = True}
Process.Start(p)

instead of
Code
C:\Users\Odus\Desktop\VBConsole.exe

I need to have it in the files location
(Jan 23, 2015 02:02 PM)Mr Fox Wrote:  instead of
Code
C:\Users\Odus\Desktop\VBConsole.exe

I need to have it in the files location

Replace with:
Code
AppDomain.CurrentDomain.BaseDirectory & "whatever.exe"


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Shell] by Robert RougeSep 24, 2026 10:03 AM 1 296 Sep 24, 2026 10:03 AM
Last Post: Anonynuk
[Shell] by ImDeepWithWindowsJul 4, 2020 06:19 PM 0 167 Jul 4, 2020 06:19 PM
Last Post: ImDeepWithWindows
[Shell] by friiz1337May 14, 2020 04:09 AM 2 207 May 14, 2020 04:09 AM
Last Post: sed-i