cancel
Showing results for 
Search instead for 
Did you mean: 

DirList Not Working Properly in Windows 7.

Former Member
0 Kudos

Hello Experts,

I have the below configuration:

OS - Win 7

PB Version - 7

I have a list box in a window which I am trying to populate using the DirList function.

I have the below code in the open event of the window:

ls_commandline = message.stringparm

this.is_dir = ls_commandline


I have the below code in the postopen() event of the window:

if len(is_dir) = 0 then

  If GetFileOpenName("Select any PBL", is_dir, ls_junk, "PBL", "PBL Files (*.PBL),*.PBL") = 1 then

       is_dir = left(is_dir, len(is_dir) - len(ls_junk))

  else

       close(this)

       return

  end if

end if

if len(is_dir) > 0 then

  if right(is_dir, 1) <> "\" then

       is_dir = is_dir + "\"

  end if

  lb_1.DirList(is_dir + "*.pbl", 0)

end if


So, the user can either select the directory through the File Open Dialog or can pass the same through the command line arguments in which case the is_dir would be already populated when it comes to this event.


Now, when i run the exe by double-clicking, the FileOpen Dialog opens and when i select any directory, the DirLIst populates the List Box with all the pbls in that directory.

But when i run the same through command prompt and pass the directory via command line arguments, DirList function is not working and it returns FALSE. I am calling the exe like this:

call C:\Users\samiagra\Desktop\pbdups.exe s:\buildsource

The same thing is working fine in Windows XP.

I also tried using the combination of FindFirstFileA and FindNextFileA API functions to populate the List Box but that didn't work either form command prompt.


Please let me know if you have face this kind of issue and is there any solution.


Thanks,

Samir

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

this could be similar to the problem discussed here:

Some questions to locate the problem:

1. Are the directories you try to open on a network drive?

2. Does the command prompt run with elevated rights (runas administrator)?

If so, please try to change the situation: Test with a local drive and/or run prompt without admin rights.

This problem can occur when the administrator doesn't share the mappings with the user logged on, for further information and workaround look at this: Some Programs Cannot Access Network Locations When UAC Is Enabled

Regards

Former Member
0 Kudos

Hi,

1. The Directory i am trying to open is not on any network drive.

2. I am running the command prompt as administrator.

Thanks.

Former Member
0 Kudos

Hi,

is there anything else "special" about the drive s:\, you mentioned in your post above? Can you access it from the command prompt with admin rights and does a "dir" work?

What happens, when you try the same with a folder on c:\?

What happens, if you run the command prompt not as administrator?

Regards

Former Member
0 Kudos

I think i found the resolution. This is working fine when i call the exe using the "RUN" command in the command prompt something like this:


Run C:\Users\samiagra\Desktop\pbdups. exe s:\buildsource