MSFN Forum: Link program to external file - MSFN Forum

Jump to content


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Link program to external file EXE looking for SYS file Rate Topic: -----

#1 User is offline   Tripredacus 

  • K-Mart-ian Legend
  • Group: Super Moderator
  • Posts: 8,670
  • Joined: 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Posted 20 August 2012 - 10:48 AM

I am working on automating a program to run from a network drive, but I am having problems getting it to run. This program has a .sys file that it uses for something, it is a filter driver. If I run the program from a c:\test with that file in there, it works fine. Due to the sensitive nature of this program, I'd rather have it run from the network drive so that it won't accidently be left on a completed system.

In previous efforts I've accomplished this by copying support files to either the script directory, or into SysWoW64/System32. Unfortunately, this program does not use search paths to find the file. In my testing:
- ProcMon does not show the EXE looking for the .SYS file.
- Depends does not show the .SYS file in the list.
- PE Explorer shows that it looks for the .SYS in the same folder as the .EXE is located.

So I am wondering if there is a way to configure Windows temporarily using Symbolic Links or an Environment variable or something else to help this EXE find its support file?

A worst case scenario is that I'll just copy it to the HDD temporarily to run the program, but I'd rather not take this step if I don't have to.

OS using here is Windows 8 Pro x64 which hopefully won't matter.


#2 User is offline   allen2 

  • Not really Newbie
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,736
  • Joined: 13-January 06

Posted 20 August 2012 - 12:21 PM

Quote

So I am wondering if there is a way to configure Windows temporarily using Symbolic Links or an Environment variable or something else to help this EXE find its support file?

You can use the path variable (it should support unc name or mapped network drive).
A simple batch launching your exe should work after modifying the path variable should work.

#3 User is offline   bphlpt 

  • MSFN Expert
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 1,077
  • Joined: 12-May 07

Posted 20 August 2012 - 07:03 PM

I believe the "normal" behavior of an app is to look in the same folder as the EXE, and if not found there to then look in all the locations defined in the PATH, in order. So I agree with allen2 that modifying the path variable should work. Afterwards, you should be able to then edit the PATH and remove that location in a clean up step.

Cheers and Regards

#4 User is offline   Tripredacus 

  • K-Mart-ian Legend
  • Group: Super Moderator
  • Posts: 8,670
  • Joined: 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Posted 21 August 2012 - 08:51 AM

View Postbphlpt, on 20 August 2012 - 07:03 PM, said:

I believe the "normal" behavior of an app is to look in the same folder as the EXE, and if not found there to then look in all the locations defined in the PATH, in order.


You are right, this is the normal behaviour, but this app isn't doing that. Normally if I run into this situation, I use ProcMon to show me where it is looking for the file, but since it doesn't show up (even with Advanced Output enabled) I can't just temporarily copy it there.

I haven't been successful at creating a Path Variable yet, but I have some other things to try out.

Update: I've determined that the PATH variable won't make a difference because the .EXE is not using that to find the file. Even if I put the .sys file in the dirs already specified in PATH, it won't run.

This post has been edited by Tripredacus: 21 August 2012 - 10:04 AM


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy