Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

Link program to external file

- - - - -

  • Please log in to reply
3 replies to this topic

#1
Tripredacus

Tripredacus

    K-Mart-ian Legend

  • Super Moderator
  • 9,913 posts
  • Joined 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Donator

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.
MSFN RULES | GimageX HTA for PE 3-5 | lol probloms
msfn2_zpsc37c7153.jpg


How to remove advertisement from MSFN

#2
allen2

allen2

    Not really Newbie

  • Member
  • PipPipPipPipPipPipPip
  • 1,812 posts
  • Joined 13-January 06

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
bphlpt

bphlpt

    MSFN Addict

  • Member
  • PipPipPipPipPipPipPip
  • 1,798 posts
  • Joined 12-May 07
  • OS:none specified
  • Country: Country Flag
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

Posted Image


#4
Tripredacus

Tripredacus

    K-Mart-ian Legend

  • Super Moderator
  • 9,913 posts
  • Joined 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Donator

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.

Edited by Tripredacus, 21 August 2012 - 10:04 AM.

MSFN RULES | GimageX HTA for PE 3-5 | lol probloms
msfn2_zpsc37c7153.jpg




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users