Intelligent Automation & Macro Software  

Go Back   Automation Anywhere, Inc. Forums > Products Zone > Automation Anywhere
Register FAQ Search Today's Posts Mark Forums Read

Automation Anywhere Post messages and questions related to Automation Software here.


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-16-2008, 12:54 PM
Superstar Superstar is offline
Junior Member
 
Join Date: Jun 2008
Posts: 10
Default Need the current directory from where .EXE is run

This should be simple. As a compiled task (.EXE) is being run, I want this task to get the current directory's (folder) full path from where it is being run.

This is very important because the deployed tasks need to access accessory data test files (word, powepoint,etc) that reside in sub-folders.

Example:

w:\Coretests\EXE\Wordtest.exe
w:\Coretests\EXE\Exceltest.exe
w:\Coretests\Testfiles\Word2003.doc
w:\Coretests\Testfiles\Excel2003.doc

The wordtest.exe task will look for ..\testfiles\WOrd2003.doc in the sub folder
but w:\coretests CANNOT be "hard coded" within the task. This is because the task will be deployed to multiple locations.

Thats why I need the current directory.

In vbs it can be done with:
shell = Shell.ExpandEnvironmentStrings("%windir%")
currentdirectory = shell.currentdirectory

That script works but it's location needs to be hard referenced when included in a task so it defeats the purpose.

I'm sure A. Anywhere has an easy solution. I just overlooked it.

Thanks.






We are deploying tasks that are designed to access "tests files" that are in the same folder


Please don't say $currentdirectory$ because this is useless. I want to run a compiled task
Reply With Quote
  #2 (permalink)  
Old 12-16-2008, 08:27 PM
forumsupport forumsupport is offline
Senior Member
 
Join Date: Apr 2007
Posts: 1,342
Default

Hello,

You can create a VB script to get the path of file and that can be assigned to the AA variable. You need to use Run Script command to execute the VBScript. From version 5.0, if task includes Run Script action, the script is also included in Exe. This will make it easier to port complex automation across many computers even tasks include external scripts.

Hope that helps.
Reply With Quote
  #3 (permalink)  
Old 12-17-2008, 12:47 PM
Superstar Superstar is offline
Junior Member
 
Join Date: Jun 2008
Posts: 10
Default

So you're saying that only in 5.0 the scripts can be emmbedded in the .EXE?
So if I'm running 4.5.2, I'm out of luck?
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -7. The time now is 09:34 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.0.0 ©2007, Crawlability, Inc.
Copyright © 2003-2011 Automation Anywhere, Inc. All rights reserved