Jump to content

Opening Folders With Ai V3.


Recommended Posts

I've spent a couple of hours on this already with no resolution. I started last night. I came to this forum and did a search for anything related to opening up folders in explorer. Like batch file issues, I've come to the conclusion that the syntax I've tried must not work properly in Win98SE (that's all I can come up with, at any rate).

I tried several attempts at using what was on the forum. I deleted _all_ my test files of the "old" syntax, the one I tried first yesterday although I meant to keep one example. Going from memory, the syntax was something like this:

Run,explorer.exe "D:\0-PROG~1\0-ZIPP~4.2\BACKUP~1\TEMPDA~2"

I tried with full path to explorer.exe and then using LFN also for folder name rather than DOS 8.3. Nothing worked. I got a parsing error stopped at the first "e" in the .exe above. So parsing error happened after "Run,explorer.e".

So I gave up on that and tried what I found in the help file for AI v3:

Run ( "C:\WINDOWS\EXPLORER.EXE", "D:\0-PROG~1\0-ZIPP~4.2\BACKUP~1\TEMPDA~2", @SW_MAXIMIZE)

This didn't quite work either though it got further. Here is the full script with this:

;

; AutoIt v3.0

;

; minimize all windows

WinMinimizeAll ( )

; open both folders, source and target

Run ( "C:\WINDOWS\EXPLORER.EXE", "D:\0- PROGRAMS\0- Zipped file - diary, The Diary v2.2\BACKUPS (unzip files to DATA fldr)", @SW_MAXIMIZE)

Run ( "C:\WINDOWS\EXPLORER.EXE", "C:\Program Files\DIARY\Diary v2.2\DATA", @SW_MAXIMIZE)

Exit

; finished

I end up getting 2 folders open, maximized, yes - but they're both of the root drive only (c:\) and I often get this error message come up:

"This folder contains 24 hidden file(s).

If you want to select these files as well,

click the folder Options command on the view menu to turn ont he the Show All Files option."

This is no good. I need to do this but without changing folder display settings yet getting the right folders to open.

Does anyone know what the correct syntax for Win98SE would be, by any chance?

Thank you!

Hypatia :ph34r:

Link to comment
Share on other sites

I found this link pretty helpful when trying to manipulate an explorer window to open up a certian way.

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Link to comment
Share on other sites

try

Run ( 'C:\WINDOWS\EXPLORER.EXE D:\0-PROG~1\0-ZIPP~4.2\BACKUP~1\TEMPDA~2', '', @SW_MAXIMIZE)

<{POST_SNAPBACK}>

I tried this line of coding by itself twice. Both times I didn't get the error message and I didn't get that despised folder tree <g>, but I still only get the C drive, the root. <?>

I'm getting rather discouraged here. I'm running a pretty standard, if slightly older machine. I have Win98SE, as I mentioned, on a 650 MHz, 128SDRAM, 11 gig machine. Nothing there that I can think of that would make this not work (?). :ph34r:

Link to comment
Share on other sites

I found this link pretty helpful when trying to manipulate an explorer window to open up a certian way.

<{POST_SNAPBACK}>

That's dandy, thanks for this site. I don't know how one would use these switches though (command line??). I'll have to look into this. I don't see how this will help with this particular AI scripting problem as I'm not getting Explorer to open the right window, but this might certainly come in handy for something else somewhere down the line.

Thanks.

Link to comment
Share on other sites

On the site pekster mentioned you can find everything you need for opening an explorer window in a directory.

What you want is probably

Run('explorer.exe /e,c:\packages')

<{POST_SNAPBACK}>

No, the point is being missed again and again and I don't know what to do. I'll try again since it's obviously something I'm not getting across properly. It's been to obvious to me that it isn't a question of which switches to use where, this isn't working, _period_. No matter what syntax has been given (and I just tried yours above), I'M GETTING A FOLDER TO OPEN IN THE ROOT ONLY! I get an open folder in Explorer on the C drive no matter what paths are used and that's it. Switches just help with _how_ Explorer will open windows, not whether it opens the right one.

I just don't know what else to do except it looks like I have to go back to bat files which I absolutely HATE! But I can't see what else to do. Absolutely everything I've tried opens up a folder in C which is no help at all as I must open a file in the Program Files folder and another on my D drive. I can just as easily open up folders in C by pressing Win+E so having AI do the same thing means I'm no further ahead but I wasted a bunch of coding to do the same thing <sigh>.

Thanks everyone for the help. The problem has not been resolved but I do sincerely appreciate all the help. You guys are the greatest for trying to help us newbies out.

Link to comment
Share on other sites

I can confim that this what Larry recommended works for me:

Run ( 'C:\WINDOWS\EXPLORER.EXE D:\0-PROG~1\0-ZIPP~4.2\BACKUP~1\TEMPDA~2', '', @SW_MAXIMIZE)

Note that all of '' characters are actually apostrophes ( ' ), not quotation marks ( " ) (also here ...\TEMPDA~2', ''... )

You can also use quotation marks:

Run ( "C:\WINDOWS\EXPLORER.EXE D:\0-PROG~1\0-ZIPP~4.2\BACKUP~1\TEMPDA~2", "", @SW_MAXIMIZE)

If neither way works for you, then I'm out of ideas. Maybe you can check if that folder really exists or something.

Edited by tuape
Link to comment
Share on other sites

No, the point is being missed again and again and I don't know what to do.  I'll try again since it's obviously something I'm not getting across properly.  It's been to obvious to me that it isn't a question of which switches to use where, this isn't working, _period_.  No matter what syntax has been given (and I just tried yours above), I'M GETTING A FOLDER TO OPEN IN THE ROOT ONLY!

[...]

I just don't know what else to do except it looks like I have to go back to bat files which I absolutely HATE!

The problem seems to be really strange. I just tested my line again and it works perfectly on Windows NT4 and on Windows XP.

Which lines work for you in the batch files? I'd like to see them if the commands provided by us don't work and I'm pretty sure they can be converted to autoit script.

Link to comment
Share on other sites

You can try this routine to attempt to feed any folder you want to the explorer program as a switch. When you run this script, it will ask you to select the initial folder in the explorer window it creates.

$my_computer = "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}"
$folder = FileSelectFolder("Pick initial folder", $my_computer)
If @error Then
  MsgBox(16, "Error", "A folder must be selected to continue")
  Exit
EndIf
Run('explorer.exe /e, "' & $folder & '"')

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

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...