Solved

How to specify the path to a script within aa vb.net windows app

Posted on 2006-11-30
1
210 Views
Last Modified: 2010-04-23
I have a windows app that will reside on a server in a folder called executables.  The executable needs to access a script that is in a folder called scripts.  Scripts and executables are level with each other.  Running from my desktop the path might look something like c:\\scripts\script.cmd.  What would it be from the server?

Users will have a shortcut on their desktop that will execute the server program and bring up a screen.  They will write a file created in part by their userid (to insure unique).  How can I direct the file to their desktop?  
0
Comment
Question by:garyinmiami2003
1 Comment
 
LVL 15

Accepted Solution

by:
Solar_Flare earned 500 total points
ID: 18049330
ok let me just clarify the question.

you have an application that will be stored on a network drive? Users have a shortcut to the network location so they can run the exe from the network drive.

the application needs to find the script file on the network drive that is in a folder at the same level as the folder that contains the exe file.





you can find out the directory an application was run from using application.startuppath, which should yield something like "x:\executables" then you could just do a replace to change the folder to scripts.

eg

dim path as string = application.startuppath
path = path.Replace("\executables", "\scripts") & "\script.cmd"

then open the script file using the path

is that the sort of thing you are after?
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question