Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Check what directory a folder is in?


  • Please log in to reply
No replies to this topic
SputnikDX
  • Members
  • 9 posts
  • Last active: Nov 05 2015 02:48 PM
  • Joined: 15 Oct 2015

I'm running a long script that goes across a few servers at work, and every time I need to get to one of these servers I can just navigate to it using \\server\etc\etc. This ensures no matter what computer the script is running on, it can get to the same folder as long as the computer itself has access to that folder.

 

Here's where the problem is though. One step in my script uses a program that needs to navigate to the DIRECTORY that that folder is in. Right now I simply navigate through that menu by sending X, the name of the directory on my computer, and everything works fine. However, X is the drive that I mapped that server to, and other computers could have it mapped to a different directory.

 

So what I'm hoping to accomplish is to check what directory a certain folder is in, then set that directory to variable %directory%, and then call on that variable when I need to use it to navigate.

 

Example:

Run \\server1\Folder\Subfolder\ ;Opens explorer to the folder I need
somehowGetAddress directory ;Some kind of magic to get the directory I'm currently in

;later

winWaitActive Directory Browser
Send %directory%
sleep 50
Send {Right}
sleep 50
;Rest of emulated keystrokes