Topic: Synchronize letters of disks  (Read 19783 times)

0 Members and 1 Guest are viewing this topic.

Re: Synchronize letters of disks
« Reply #40 on: October 27, 2012, 09:38:09 AM »

NIKZZZZ

  • Code Baker
  • Jr. Chef
  • **
  • Date Registered: Feb 2011
  • Posts: 64
Fixed bug - incorrect operation if in guest system drive x::
.au3 version full  compatible with au3361 or later.
Regards,
Nikzzzz.

Re: Synchronize letters of disks
« Reply #41 on: October 27, 2012, 09:42:00 AM »

NIKZZZZ

  • Code Baker
  • Jr. Chef
  • **
  • Date Registered: Feb 2011
  • Posts: 64
 ------------------

Re: Synchronize letters of disks
« Reply #42 on: October 29, 2012, 12:51:33 AM »

Lancelot

  • Moderator, Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7010
Thanks Nikzzzz,

Sorry for delay, time pass quickly,
Both Win7PESE and Gena updated latest LetterSwap now   :great:

:ymca:

Re: Synchronize letters of disks
« Reply #43 on: February 24, 2013, 06:30:06 PM »

anshad

  • Chef
  • ***
  • Date Registered: Apr 2012
  • Posts: 323
Hi Nikzzzz

New letterswap.exe won't work without autoit executable in System32. New script works fine in Win7PE SE as autoit is enabled by default but won't work with Gena if Autoit script is not enabled. There is no instruction in the script interface to enable Autoit. Script should be either updated to copy Autoit executable to System32 or letterswap.exe should be updated to a standalone exe.

Re: Synchronize letters of disks
« Reply #44 on: February 24, 2013, 09:31:32 PM »

Lancelot

  • Moderator, Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7010
Hi anshad,

can you test if using au3361.exe filename ok ?

If,Not,ExistFile,%target_sys%\AU3361.exe,FileCopy,%Tools%\%SourceArch%\AU3361.exe,%target_sys%

Re: Synchronize letters of disks
« Reply #45 on: February 24, 2013, 10:40:07 PM »

ChrisR

  • Win7PE SE Baker
  • Grand Chef
  • *****
  • Date Registered: Mar 2011
  • Posts: 2809
Hi anshad,

Here, I think better

in line 52  after
//-- autorun PE1
If,Not,ExistFile,%target_sys%\AU3381.exe,FileCopy,%Tools%\%SourceArch%\AU3381.exe,%target_sys%

Re: Synchronize letters of disks
« Reply #46 on: February 25, 2013, 01:08:02 AM »

anshad

  • Chef
  • ***
  • Date Registered: Apr 2012
  • Posts: 323
Hi Lancelot and ChrisR

Yes, AU3361 wont work with letterswap. It requires  AU3381. Adding
"If,Not,ExistFile,%target_sys%\AU3381.exe,FileCopy,%Tools%\%SourceArch%\AU3381.exe,%target_sys%" to the process section of letterswap script did the job :thumbsup:

But...
letterswap.exe inside script+AU3381 consumes more than 700 kb while standalone letterswap.exe is only around 280 kb. As Win7PE SE includes AU3381 by default it is not a problem but in Gena isn't it good to use a standalone letterswap.exe?


Re: Synchronize letters of disks
« Reply #47 on: February 25, 2013, 03:25:48 AM »

Lancelot

  • Moderator, Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7010
Hi anshad,

Gena also includes AU3381 as default, but optional  :wink:

story behind is:
using standalone autoit-exe take extra space as you indicated, 280 -> 700
 a time ago a suggestion made (on a topic I can't remember ... ) to use less space for au3-executables ... since everytime ~500kb wasted...

JFX came with these executables idea, depending on autoit-exe , which he initially used on another utility
( or ChrisR remembered JFX method on this matter of exe size reduction)
...
updates made on plugins,
 we followed ChrisR updates, but obviously we miss this au3... line on plugins since Gena default have au3361.exe (or autoit.exe .. ) ;)

small mistakes happens time to time  :wink:

See You
 :turtle:

Re: Synchronize letters of disks
« Reply #48 on: February 28, 2013, 02:37:04 AM »

anshad

  • Chef
  • ***
  • Date Registered: Apr 2012
  • Posts: 323
Hi

I found a problem between Gena and letterswap.exe. In Win7PE SE letterswap.exe works fine and all remapped drive letters are shown in explorer. In case of Gena sometimes Explorer won't updates properly and some remapped drives are not shown :confused:. We could see and open all drives from disk management so it is the explorer that is misbehaving. If i kill the explorer and restart it manually all drives will be shown properly. This issue happens only in some systems.

 My idea is to create a batch file which executes "letterswap.exe /auto" and then somehow updates/refresh explorer. Does anyone know how to do that?
« Last Edit: February 28, 2013, 02:37:55 AM by anshad »

Re: Synchronize letters of disks
« Reply #49 on: February 28, 2013, 04:59:21 AM »

Lancelot

  • Moderator, Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7010
one idea,
have you tried restarting mounstorpe ?

about restarting Explorer:
there is a complication about that, what you use as "loader" matters  :wink:

*
If you are using "XPELogon" (Gena Default),
 you can restart explorer as in windows
  (10 lines with ckill and one like to start explorer.exe would be enough I guess)

ckill : http://theoven.org/index.php?topic=53.0

That is the main reason XPELogon is Gena Default  :wink:

ps: please check IF XPLogon has a parameter to restart shell ??? if there is I can put a shortcut option for that...

*
If you are using "PELoader", as far as I remember it shuts down PE when shell (explorer) dies

Also, you can make a "batch" as shell, so when explorer dies, it automatically starts explorer.exe
(maybe pecmd can make same without batch !!??)

*
PE1 default behaviour for shells is "shut down" as with PELoader (nobody use this option anymore)

ps: my memory says,  peloader and pe1 default behaviour change if you use remove 24-h limit...

*
I do not know "PECMD" behaviour, but I may guess it is acting like xpelogon ? (or may act like xpelogon) ???


++++
Shortly:
 If your goal is restarting shell, with default gena with xpelogon it is like in normal windows,
  if you play with loaders, than be carelful.  :wink:

tip: you can change shortcut option to minimize with batch xx.cmd shortcuts.

See you
:ymca:
« Last Edit: March 01, 2013, 06:44:38 AM by Lancelot »

Re: Synchronize letters of disks
« Reply #50 on: February 28, 2013, 01:23:05 PM »

Galapo

  • Moderator, Gena Baker
  • Grand Chef
  • *****
  • Location: Australia
  • Date Registered: Sep 2010
  • Posts: 1915
(free-distributable alternative to pskill will be nicer  :wink:)

Yep, remember we have CKill, both 32- and 64-bit: http://TheOven.org/index.php?topic=53.0

Regards,
Galapo.

Re: Synchronize letters of disks
« Reply #51 on: February 28, 2013, 06:14:42 PM »

anshad

  • Chef
  • ***
  • Date Registered: Apr 2012
  • Posts: 323
Hi Lancelot and Galapo

Thanks for your support. I found a better fix by using latest "nircmd" from Nirsoft. It is only 47kb in size and can do a shit load of things.I have "nircmd" in all my build. This is my batch :

Code: [Select]
@echo off
letterswap.exe /auto
nircmd restartexplorer
exit

Everything worked until i found a new issue- in some systems XP installer assigns CD drive letter "D:" instead of assigning it the letter following last HDD partition. For example if we have 2 partition, instead of giving "e:" to the CD drive XP may assign D to CD and E to 2nd partition. If we boot Gena in that machine letterswap will read it's registry and remap CD drive's letter to "D:"  :mad: Then "%CDDrive%" variable becomes invalid and all my app shortcuts from CD drive will also be gone :sad: This is not a an issue in Win7PE SE as letters A,B,X,Y, and Z are ignored by default ( CD drive is Y)

 Then i found a cure by modifying my batch.

Code: [Select]
@echo off
letterswap.exe /auto /ignoreletter %cddrive% /log %temp%\lslog.txt
nircmd restartexplorer

So far everything works fine :cool:

It will be good to include a "ignoreCD" option in letterswap's next version to ease things.

Note: i tried the "letterswap.exe /auto /ignoreletter %cddrive% /log %temp%\lslog.txt" in the autorun box of letterswap script but that don't seems to work. I doubt %cddrive% is not available during startup (already discussed in "portable finder CMD" topic). So "ignoreCD" is a must have.

"nircmd" do have "closeprocess" and "killprocess" option to terminate processes and "sysrefresh environment" option to broadcast environment variable change. It is allowed to freely distribute as long as we don't charge for the download so it can be used with Gena and Win7PE SE scripts.
   
« Last Edit: February 28, 2013, 06:29:55 PM by anshad »

Re: Synchronize letters of disks
« Reply #52 on: February 28, 2013, 08:11:48 PM »

Galapo

  • Moderator, Gena Baker
  • Grand Chef
  • *****
  • Location: Australia
  • Date Registered: Sep 2010
  • Posts: 1915
Hi anshad,

I recompiled a new x86 version for you to test. It accepts an optional commanline parameter '/restartexplorer'.

https://dl.dropbox.com/u/3801579/temp/LetterSwap.exe

The %CDDrive% variable is only available quite late in the boot process. To get around that you could try 'Add_Shortcut,AutoRun'.

Regards,
Galapo.

Re: Synchronize letters of disks
« Reply #53 on: March 01, 2013, 12:13:52 AM »

anshad

  • Chef
  • ***
  • Date Registered: Apr 2012
  • Posts: 323
Hi Galapo

Yes, new "restartexplorer" option works fine :thumbsup:

Code: [Select]
@echo off
letterswap.exe /auto /restartexplorer /ignoreletter %cddrive% /log %temp%\lslog.txt


Re: Synchronize letters of disks
« Reply #54 on: March 01, 2013, 01:23:49 AM »

Galapo

  • Moderator, Gena Baker
  • Grand Chef
  • *****
  • Location: Australia
  • Date Registered: Sep 2010
  • Posts: 1915
Hi anshad,

Ok, great.

I've got another test for you, because I don't know if the way I've coded it will work. Redownload an updated test version from the link and test the following code: https://dl.dropbox.com/u/3801579/temp/LetterSwap.exe

Code: [Select]
@echo off
letterswap.exe /auto /restartexplorer /ignorecd /log %temp%\lslog.txt

If this doesn't work, I code another way.

Thanks,
Galapo.

Re: Synchronize letters of disks
« Reply #55 on: March 01, 2013, 04:39:34 AM »

anshad

  • Chef
  • ***
  • Date Registered: Apr 2012
  • Posts: 323
Hi Galapo

Thanks for the test version :smile:. Unfortunately new "ignorecd" switch didn't seem to work. Waiting for your update.... 

Re: Synchronize letters of disks
« Reply #56 on: March 01, 2013, 07:03:09 AM »

Lancelot

  • Moderator, Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7010
sorry Galapo,
You know how much I like ckill, I knew I am forgetting sth.. but in a rush I forgot...
changed my post   :thumbsup:

*
@anshad,
for startup batches where cddrive used..
a roadpath made before http://theoven.org/index.php?topic=468
already available inside Apps\System Tools\"Portable Finder CMD" plugin  http://theoven.org/index.php?topic=370

*
and an info add:
I guess, using nircmd , you can close all open explorers (file manager ones) than kill explorer.exe, which will result 2 lines ;)
but still there is this letter problem....
(which seems to me a bit normal with description "Synchronizes letters of disks Host & Guest OS"

*
@Galapo
I guess solid solution would be:
reading cddrive variable at first place IF exists --> than you need to take an "ID" of this device ,
 than after restart if it is not mounted correctly, remount it ;)  ( with mountvol.exe ?!?)

I may guess what I mean with "ID" can be taken from HKLM\SYSTEM\MountedDevices

besides after* tests dependency to mountvol.exe can be removed too since we already have working codes   :cool:
(either inside LetterSwap or BlueLife MountVol)

or shortly:
maybe whatever hapening has an effect to HKLM\SYSTEM\MountedDevices or similar that cause cd-drive letter change ??
after killing, adding id and continue starting ... is a similar solution without using mountvol kind step....

all need to be tested  :cool:


AND :)
Aside adding to LetterSwap.exe
 I feel better an individual "ExplorerRestart.exe",
  which I believe would make your coding easier and would ease future hunts of "Explorer Restart" conditions,
than same codes can be used with letterswap or not, up to you ....

:turtle:

Re: Synchronize letters of disks
« Reply #57 on: March 01, 2013, 09:56:47 AM »

Lancelot

  • Moderator, Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7010
things come to my mind, just remembered:

I knew I had thought this situation before ;)
and now I remember why I use manual way....

on "MountedDevices Host" , to avoid such thing, I deleted A: B: X:  Y:  during import-export  , which I know have weak point ;)
(I believe no weak point since at bootup things will be adjusted - overwritten by system ;)  , naturally letterswap works other way, overwrite what system made)

the main trouble seems to me: find / detect which letters PE (running os) uses actively,
secondary: a routine not touch these letters ..


I guess system already takes systemdrive ok ,
 cddrive is only a case which anshad catched due to popular usage,
  but there are others like ramdisk drive letter, wimpack driveletter and "whatever driveletter" ...
   It is to me impossible to detect all drive letters used (configured) by system ...
    (and very absurb to but an env. var. for them , an idea is to write a registry info .... ...)



from this idea , back to first step:
The goal of using letterswap, to me, getting "disk"s letters correct,
to benefit
1) working junctions/symb links etc. (which is to me most important part)
2) I feel things will be easier when checking offline hives (following paths would be easier...)
3) better visual (so you see what you are familiar with or how system configured)

so I guess, better design letterswap in a way, to correct "disk" letters only, and warn if there is a conflict etc.... (visual designs, popup message "do you agree" etc... )

reminding: more more situations makes things more more complicated:
 bootdi can boot from real-disk (image), bootloader can be configured in a way to have disk-image-loaded side by side, gavotte can create real-disk on ram or on .ima-img etc. etc. ....
 things can be very mixed easly with letterswap...



or easy path  :wink: (time time :turtle:),
 you can ignore the "popular" ones (A: B: Y: X: ),
   knowing in mind there is still a "weak point" which one might face 1/10000  :wink:



I hope this gives a better picture, and quick fix (my advice , use easy path) :great:

Re: Synchronize letters of disks
« Reply #58 on: March 01, 2013, 06:25:00 PM »

anshad

  • Chef
  • ***
  • Date Registered: Apr 2012
  • Posts: 323
Hi Lancelot and Galapo

Thanks for your continued support to solve the issue.

Lancelot is right about the complications. But Wimpack is not a widely used option so i think we can ignore it and we could force the use of "B:" as Imdisk ramdisk or just warn the user changing drive letter may lead to complications. As an alternative a user who use "R" as his RAMdisk letter can use "ignoreletter R:" to exclude it.

 On the other hand "CDDrive" is a widely used variable and it is not a fixed letter and that made the complication. Chances are high to get it remapped. Someway to prevent it will be useful to most users. In my case i don't use letterswap in startup. I have a shortcut in my desktop which executes "letterswap.exe /auto /restartexplorer /ignoreletter %cddrive%" and it works great thanks to you. It can also be used with "Portable Finder CMD" with Lancelot's cddrive variable fix line.       

Re: Synchronize letters of disks
« Reply #59 on: March 01, 2013, 06:47:46 PM »

Galapo

  • Moderator, Gena Baker
  • Grand Chef
  • *****
  • Location: Australia
  • Date Registered: Sep 2010
  • Posts: 1915
Hi anshad,

Please download an updated version and test: https://dl.dropbox.com/u/3801579/temp/LetterSwap.exe

What I would like you to do is first test this in your batch file:

Code: [Select]
@echo off
letterswap.exe /auto /RestartExplorer /IgnoreCD /log %temp%\lslog.txt

Then I would like you to test this by the normal method, not your batch file run after startup.

Code: [Select]
letterswap.exe /auto /RestartExplorer /ignoreletter %cddrive% /log %temp%\lslog.txt

I've coded a routine taken from ExpEnvVar.exe that should hopefully expand the variable that hasn't been broadcast systemwide yet.

Thanks,
Galapo.

 

Powered by EzPortal