Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 217
  • Last Modified:

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

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
garyinmiami2003
Asked:
garyinmiami2003
1 Solution
 
Solar_FlareCommented:
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now