Jump to content

Wrong path with @scriptDir


 Share

Recommended Posts

Hi,

I'm using AutoIt in a robotframework test to handle a windows file dialog. The AutoIt script runs fine on my machine but the same

script on the PC of my colleague has a wrong @scriptDir path.

The line is: ControlSetText("Öffnen", "", "Edit1", @ScriptDir & "\..\data\Test.xml")

On my PC the path is as expected.

On the PC of my colleague the path is the windows user directory. I'm really puzzled.

 

Cheers,

Marc

Link to comment
Share on other sites

- The script is in the path G:\git\test\team_test\PBI_1\src\Script.exe

- The "Test.xml" file has the path G:\git\test\team_test\PBI_1\data\Test.xml

- With "user directory" I mean e.g. "c:\users\User_ABC"

 

Link to comment
Share on other sites

8 hours ago, marc1 said:

- The script is in the path G:\git\test\team_test\PBI_1\src\Script.exe

- The "Test.xml" file has the path G:\git\test\team_test\PBI_1\data\Test.xml

So the script is under the folder SRC, This means the path is wrong, since what you're saying to the script is basically that the test.xml is in a subdir of SRC..which is not, it is under data.

@scriptDir = G:\git\test\team_test\PBI_1\src

So when you combine it, like this @ScriptDir & "\..\data\Test.xml" it becomes:

G:\git\test\team_test\PBI_1\src\data\Test.xml

What you have to do, to keep the things as they are, is to simply remove some characters from the @scriptDir.

example:

StringTrimRight(@scriptDir, 4) ;Remove \src

This would equal G:\git\test\team_test\PBI_1

Then you can add the rest of the path on top of this and all will be fine, because Data does reside under it.

Sry for the long post.

Edited by careca
Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

Maybe you have some fileinstall lines?

Lines that place the needed files in the right folders.

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...