Page 1 of 1

Need idea on setting a directory in the File Explorer

Posted: Wed Jan 12, 2022 2:13 am
by TerryHough
Here is a code snippet

Code: Select all

URL$ = "https://filencdor.ondemand.sas.com/eNC3Web/"
SetCurrentDirectory("C:\SomeDir\SubDir\")
RP.l = RunProgram(URL$,"", GetCurrentDirectory(), #PB_Program_Open)
If RP
  WaitProgram(RP)
  CloseProgram(RP)
EndIf
End
This accesses a webpage that is designed to select and have files uploaded it to it. If you access that page, click on the Test Format button at the bottom.

This opens a local explorer window, but it ALWAYS opens on the last local directory that was opened on a previous access.

I want to be able to set the directory to be accessed before accessing the webpage, but I cannot seem to find a way to do so.

Ideas appreciated.

Terry

Re: Need idea on setting a directory in the File Explorer

Posted: Thu Jan 13, 2022 7:58 am
by Rinzwind
You can't since it is the browser which decides what to show. Even a website can't demand what is the start directory. I guess most use the last chosen location.

Re: Need idea on setting a directory in the File Explorer

Posted: Thu Jan 13, 2022 8:38 am
by BarryG
Albert90 wrote: Thu Jan 13, 2022 7:28 amThis is just a simple code example of how to create a directory in the file explorer using C#
You know this is a BASIC forum, right? I don't understand any of your posts, especially the "what's the best vacuum cleaner" one. I'm hedging my bets that you're a spammer and/or bot, because nothing you've posted so far has had any relevance to PureBasic at all. Your replies seem to be based on trigger text of preceding posts.

Re: Need idea on setting a directory in the File Explorer

Posted: Thu Jan 13, 2022 8:47 am
by #NULL
I also wonder if AI-Bert is human (the avatar also looks similar to those AI generated faces).

Re: Need idea on setting a directory in the File Explorer

Posted: Fri Jan 14, 2022 8:06 pm
by ChrisR
You can open the explorer on a specified folder using /e,[Path]

Code: Select all

;OpenDir$ = "/e,C:\SomeDir\SubDir\"
OpenDir$ = "/e," + GetTemporaryDirectory()
ShellExecute_(#Null, @"Open", @"explorer.exe", @OpenDir$, @"", #SW_NORMAL)