Process.Start to run exe in same folder as application is - vb.net

When I am running
myProcess = Process.Start("something.exe")
and want to start it using button it doen not find the file - i need to execute it from the same folder where application is how can i do that? Thank you.
System could not find this file - but it is there . in the same folder as application.
Using Visual Basic 2008 Express

When I add there this:
System.Diagnostics.Process.Start(System.IO.Path.Combine(My.Application.Info.DirectoryPath, "something.exe"))
It is working thanks for help - FIXED :-)

You should try something like
Process.Start(System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "notepad.exe"))

When running from VS the folder with your application is the bin/Debug or bin/Release. The program should be there.
Another option is to add the path to the program extracted from Assembly.GetExecutingAssembly().GetName().CodeBase

Related

VB.net: exe file doens't work properly when called from Process.Start(...)

I am using VB.net.
I have problem with this command: Process.Start(System.Configuration.ConfigurationManager.AppSettings("ALL_ORACLEINTERFACEFILE"))
In appsetting of web.config, we found:
The problem is like this: Basically, SMSToOracleInterface.exe does two tasks:
Create a files in a local folder
Copy the files to a folder on Server.
When I double click the exe file directly, it worked well. However, when I run the web application (the application that contain Process.Start...), it did only the 1st task. 2nd task is not done at all.
Really appreciate your help.
The answer is that when we click .exe file to run, it get my window credentials to access the folder on server. Meanwhile, when we run from web application, it doesn't have credentials to access server.

How do I build a sencha app to target production in a specific folder?

Using the latest Sencha Cmd tool v4.0.2, how do I build an app for production mode into a specific folder not into its default build folder within the app folder.
I am trying to do this from the command line but not succeeding at all.
Tried this according to their help on command line but had no success with it for several weeks now:
Sencha Cmd broken: Why does 'app build' ignore any command line parameters?
No-one seems to know what the issue is. Am I the only person in the world who is actually encountering an issue with this!? Any help appreciated from anyone with some knowledge of the Sencha products greatly appreciated.
Found the answer to this as the last post in the thread:
http://www.sencha.com/forum/showthread.php?247180-Sencha-Cmd-v3.0.0.190-does-not-use-app.json-buildpath-settings/page2
I added the following to the sencha.cfg within the .sencha\workspace folder.
workspace.build.dir=C:/builds/TolMobile
Not sure why packager.json contains an output path with the following:
"outputPath":"../build/",
It doesn't seem to even be used. If its redundant why don't they just remove it? In addition I still haven't got their command line arguments to work either. Strange.
change "outputPath" in packager.json file.
/**
* #cfg outputPath
* #required
* This is where the built application file with be saved. Make sure that output path is not in your input path, you may get into endless recursive copying
*/
"outputPath":"../build/",
then build with no cmd parameters .. >sencha app build production
To built the builds folder relative to your project.
Add to the .sencha/app/sencha.cfg
workspace.build.dir=builds/

Include and Call PDF File in vb.net (after Deployement)

Glad to see this site, Thanks guys for being active. :)
I have a problem in Visual Studio 2010/VB.Net
I have windows form in Visual Basic, I deployed the software(form) to one installer
Now I want to open My PDF file( i-e: Specific) with Button_Click_Event
I know that:
Process.Start("MyPDF.pdf")
But I dont know if user install my software in his PC so may be he install the software in C D or other directory, and also I dont know How to include PDF file in my project :)
Please suggest for me, I am searching this every where but failed so pl help me
Use Add->Existing Item on your Project. Then add the PDF File to your Project.
Afterwards you have to set the Properties of the newly added file to the following:
Now the file will be added to your "Output" Directory after you build your Project.
Now use your Process.Start("MyPDF.pdf") call. It will open up, as it resides in the same directory.
This is rather easy:
Simply include the file by dragging it to your project folder and in its options, tell it to copy to the build directory.
Thereafter, find the path through the my.application methods.
Build a correct path from that and launch it via process.start

Creating new file in Aptana 3 without creating a new project

How would I be able to create a new .php or .html (examples) in Aptana 3 without going to the process of creating a new project file in order to accomplish it.
I am running on a Mac and running Aptana Studio 3.2.2
If someone could lead me to the right direction with a link to how, that would be awesome. Thanks!
Every file need to be part of a project.
I use to keep a spare project where I can quickly open temporary working files without the need to create a new project.
File>New From template>HTML>Choose the type of HTML file you would like to create and you are set

execute file .lnk in vb.net

i need to execute a .lnk file in vb.net (lnk file that points at an exe file).
how can i do?
shell("path/file.lnk")
don't works
thx you for help.
You didn't indicate your platform, but on Windows 7, use Process.Start to launch an application using a .lnk file:
Process.Start(pathToLink)