Solved

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

Posted on 2006-11-30
1
207 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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

763 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now