Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Within arcpad (edit form) I want to get the current location of the vbs script running. This simple vbs script outside of arcpad works fine.

wscript.echo " " + Wscript.ScriptFullName

However, when I call this statement within a button click event in arcpad is gives and error and says object wscript required.

I also tried this:

Dim sCurPath
sCurPath = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".")
Application.MessageBox(sCurPath)

However, I'm getting

C:\Users\username\Desktop

directory (not location of vbs script).

Any ideas of how to find current directory of vbs script running in arcpad edit form?

Thanks

share|improve this question
    
As far as I know you cannot use wscript in ArcPad, however the second snippet you posted works for me, are you sure your script is stored where you think it is stored? –  sgrieve Dec 13 '12 at 14:32
    
@sgrieve, Yes the vbs file is not in the C:\Users\username\Desktop directory. –  artwork21 Dec 13 '12 at 14:36
    
I'm not really sure what to suggest then, I inserted that code into one of my ArcPad projects and it gave me the correct working directory. Could you post the rest of the module? Maybe something odd is interfering with the command. –  sgrieve Dec 13 '12 at 14:43
1  
@sgrieve, I tried the code against another layer/vbs file and it worked. Not sure still what is going on in the one vbs file though (will post if I figure it out), thx! –  artwork21 Dec 13 '12 at 21:25
add comment

1 Answer

You do not have to specify wsscript...... ArcPad, by default, supports VBscript and Jscript and Python script if you have the python interpreter installed. Therefore, just use the regular VBS syntax. Hope this helps.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.