Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-10-2016, 09:10 AM
vince692 vince692 is offline Get relative Path to toto.exe Windows 7 64bit Get relative Path to toto.exe Office 2010 32bit
Novice
Get relative Path to toto.exe
 
Join Date: May 2016
Posts: 22
vince692 is on a distinguished road
Default Get relative Path to toto.exe


Hello,

I have toto.exe under C:\ProgramFiles\...\
Is there a way to search for this executable path ?

BR,
Vincent
Reply With Quote
  #2  
Old 05-10-2016, 02:15 PM
macropod's Avatar
macropod macropod is offline Get relative Path to toto.exe Windows 7 64bit Get relative Path to toto.exe Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Since the path will be absolute, not relative, you need to work with that. Searching all the subfolders under C:\ProgramFiles\ for toto.exe is possible, but will slow down your code's execution every time you run it and really shouldn't be necessary.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 05-11-2016, 12:16 AM
vince692 vince692 is offline Get relative Path to toto.exe Windows 7 64bit Get relative Path to toto.exe Office 2010 32bit
Novice
Get relative Path to toto.exe
 
Join Date: May 2016
Posts: 22
vince692 is on a distinguished road
Default

Hi,

For my computer it is absolute... but i need relative path to share my program.
The only way to find toto.Exe is to search recursively from a parent folder the executable ?
Is it possible to do this recursive search for the first execution and store the new path executable path into a global variable... (dunno if it exists in vba...)

BR,
Vincent
Reply With Quote
  #4  
Old 05-11-2016, 12:42 AM
macropod's Avatar
macropod macropod is offline Get relative Path to toto.exe Windows 7 64bit Get relative Path to toto.exe Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Yes, it's possible to do a recursive search and store the path but there is no built-in VBA 'recursive search' function - it would have to be written - and, unless you store the path in a file somewhere, the found path would only be available to the current session.

Since neither of your threads have said anything about what you're trying to achieve, this is all like trying to find a black cat in a warehouse at night (and no torch).
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 05-11-2016, 01:03 AM
vince692 vince692 is offline Get relative Path to toto.exe Windows 7 64bit Get relative Path to toto.exe Office 2010 32bit
Novice
Get relative Path to toto.exe
 
Join Date: May 2016
Posts: 22
vince692 is on a distinguished road
Default

My goal is to execute a macro in a Word Document which execute toto.exe with argument "DocumentPath".
Store the absolute path in a .ini file seems to be a good solution.
Do you have example about how to do a recursive file search ?
Reply With Quote
  #6  
Old 05-11-2016, 02:22 AM
macropod's Avatar
macropod macropod is offline Get relative Path to toto.exe Windows 7 64bit Get relative Path to toto.exe Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by vince692 View Post
Do you have example about how to do a recursive file search ?
See, for example: https://www.msofficeforums.com/word-...html#post47785
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 05-11-2016, 06:32 AM
vince692 vince692 is offline Get relative Path to toto.exe Windows 7 64bit Get relative Path to toto.exe Office 2010 32bit
Novice
Get relative Path to toto.exe
 
Join Date: May 2016
Posts: 22
vince692 is on a distinguished road
Default

Thanks a lot
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Relative path between two word documents and text KenZu Word 2 10-16-2013 03:23 PM
Get relative Path to toto.exe Relative path to a video file dedine PowerPoint 3 01-31-2013 12:55 PM
Get relative Path to toto.exe Relative path for video link? Is it possible? Baudisson PowerPoint 1 01-10-2012 02:19 AM
Get relative Path to toto.exe Relative path to desktop b0x4it Word VBA 4 05-18-2011 11:50 PM
attaching (relative,logical or virtual) path to template word document wissam Mail Merge 0 08-04-2009 05:09 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:24 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft