I need to write a batch file which gets the path for a folder(e.g. lib) located in the current directory of the batch file and tell my computer to use my dll files located in there.
Anybody knows how to do this?
Thanks,
I have resolved the problem by changing the approach. Now I add my library into a given folder and then add its path to PATH environment variables by a batch file. Then run my exe file.
Related
I want to create an Exe that copies files to a directory on the c drive.
So I want it to this.
I have added the files to the project.
And when I run the code. It copies the file.
My.Computer.FileSystem.CreateDirectory("C:\direcotory1")
My.Computer.FileSystem.CopyFile("file1", "c:\direcotry1\file1.dat")
The above code works, but...
After I compile if I move the exe out of the source directory, it doesn't work. I have to leave the exe in the directory where the file is.
Phrased another way. IF the exe is not in the directory it gets compiled into by Visual Studio. Then it cannot find the file to copy.
I know people do this all the time, but I am not sure how to get them in there.
Properties are set to content, or embedded resource don't seem to make a difference.
Can anyone give me the piece I am missing?
Thanks
Dan
I'm writing a project documenter and I write out the full file path of each compiled file. This is for the VB.NET language so .proj files are written in xml.
Any file that is linked to the project exists on the same drive so at least one of the directory levels are the same for all files. I currently have it set up to put the project directory path on files which exist inside the project since it only shows the name of the file and the residing directory it lives in if its in a directory inside the project. For files outside (linked in) to the project I initially saw their files paths were "..\..\..\dir\filename". So I set it up to take off all the "..\" and put the necessary directories in front of it and all that worked fine. Now for this one .proj file some of the linked in files have their full file path with no "..\".
How can I properly distinguish these three possible inputs?
System.IO.Path.IsRooted will tell you whether a path is rooted, i.e. is a full path, or not. If the path is not rooted it is a relative path. You can use Path.Combine to resolve the full path from a relative path.
In each monkeytalk project, there exists a MonkeyTalkAPI.js file in the "lib" folder. It is same for all the projects. WHat does this file actually do?
To run a javascript file, we need a browser. SO how does this file get executed?
It declares common objects (Device, Application, Script etc.) that are used by your xxxMTTest.js
I am writing a MSBuild script for creating a one click deployment. Everything works great but the files are created in the app.publish under the bin directory. Is there a way to set the output directory to another directory instead of the default bin directory?
I used PublishDir but that just creates the setup.exe in the specified directory. The other files are still created under the bin directory.
Can route all the one click deployments to a specific directory or do I have to copy later?
Thanks,
Richard.
Have you tried OutputPath instead?
msbuild my_solution.sln /p:OutputPath=c:\my_dir
I have added some files that I need to be downloaded to the Application start up path. So I set Build Action as content now the files have been copied some where
C:\Documents and Settings\TestUser.ANNAM\Local Settings\Apps\2.0\Data\HVDRBMY5.8AA\858AT9VM.TNP\test..tion_2d7cfc137d9c2c74_0001.0013_432bd4561850d290\Data
How can access file from the application. My problem since it is a dynamic path will it be same folder count so that we can use like ..\..\Data\ Some think like this
Application.UserAppDataPath gets the path for the application data of a user.
Application.StartupPath gives you the path for the executable file that started the application, not including the executable name.
Starting with one of these, you should be able to use System.IO to manipulate the paths until you get the folder where your data files are.