cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SetCurrentDirectoryA Doesn't Work

Former Member
0 Likes
1,660

I'm trying to dynamically configure the working directory by calling the external kernel32 SetCurrentDirectoryA function, but no matter what I pass in as the path, it always seems to return false. What would make that happen? I'm using PB 12.6 classic on Win 10 desktop.

View Entire Topic
Former Member
0 Likes

Why not just use the PB directory function instead of calling the windows api?

also PB is moving on: https://community.appeon.com/

--------------------------------------

ChangeDirectory PowerScript function

Description

Changes the current directory.

Syntax

ChangeDirectory ( directoryname )

Argument

Description

directoryname String for the name of the directory you want to set as the current directory

Return Values

Integer. Returns 1 if the function succeeds and -1 if an error occurs.

Examples

This example changes the current directory to the parent directory of the current directory and displays the new current directory in a SingleLineEdit control:

ChangeDirectory( ".." )
sle_1.text= GetCurrentDirectory( )