Solved

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

Posted on 2006-11-30
1
209 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

832 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