Page 1 of 2

cmd to script?

Posted: 11 Dec 2013 20:17
by yusef88
start firefox.exe -Profile "afox/"

Re: cmd to script?

Posted: 11 Dec 2013 21:17
by yusef88
Possible to make command prompt figure out what's the drive letter of portable xyplorer folder?
cmd /K "cd /d ?:\xy portable\"
goto get("driveletter", "data", "?:\xy portable\"); //soft drive letter

Re: cmd to script?

Posted: 11 Dec 2013 21:29
by highend
<xydrive>

Help - Advanced Topics - Variables...

Re: cmd to script?

Posted: 11 Dec 2013 23:53
by yusef88
thanks for replay highend
I run xyplorer and firefox in portable mode and use this command to run firefox

Code: Select all

<xypath>\afox.bat
the batch contain this

Code: Select all

start firefox.exe -Profile "afox/"
is there any possibility to start firefox directly by script? soft drive letter can do any trick in my case?

Code: Select all

get("driveletter", "data", "?:\xy portable\"); //soft drive letter

Re: cmd to script?

Posted: 13 Dec 2013 17:27
by binocular222

Code: Select all

Run """C:\Program Files\firefox.exe"" -Profile afox/"
Note that any switch with space must have double quote

Re: cmd to script?

Posted: 13 Dec 2013 21:42
by yusef88
binocular222 wrote:

Code: Select all

Run """C:\Program Files\firefox.exe"" -Profile afox/"
Note that any switch with space must have double quote
what will happen it creates a new folder named afox in C:\Program Files\firefox directory, i want run my firefox profile as a relative path, in any case it is not so that important it works by batch and it's ok. just curious to know if XY could do it :) ,thanks binocular222

Re: cmd to script?

Posted: 14 Dec 2013 01:44
by highend
Where exactly does this profile folder exist? Show the complete folder hierarchy.

Re: cmd to script?

Posted: 14 Dec 2013 03:06
by yusef88
on thumb drive and it's letter manged by windows so it changes every time i plug it
something like that H:\xy-portable\afox\ batch file must be placed in the root folder that contains the firefox profile to start correctly

Code: Select all

H:\xy-portable\afox\
<xypath>\afox\
do you get me? :)

Re: cmd to script?

Posted: 14 Dec 2013 03:22
by binocular222
If you run XY from that USB, then <xypath> is already portable (not depend of drive letter)
i.e: Paste this in address bar and press enter:
::echo <xypath>

If you want to get the drive letter that XYplorer is running on, then use a question mark ? i.e:
Run """C:\Program Files\firefox.exe"" -Profile ""?\Somefolder\afox/"" "

If you don't run XY on that USB, then use this:

Code: Select all

 $USBdrive = trim(get("drives", 2), '\');;
 Run """C:\Program Files\firefox.exe"" -Profile ""$USBdrive\Somefolder\afox/"" "

Re: cmd to script?

Posted: 14 Dec 2013 17:03
by yusef88
wow it's working exactly as I want. binocular222 many thanks to you :D

Code: Select all

 $USBdrive = trim(get("drives", 2), '\');;
 Run """%programfiles%\Mozilla Firefox\firefox.exe"" -Profile ""$USBdrive\xy-portable\afox/"" "
let's say i have another usb plugged before so it will use it instead the one i work with it

Re: cmd to script?

Posted: 14 Dec 2013 17:14
by highend
First usb drive with that folder wins...

Code: Select all

    $folderName = "xy-portable";
    $usbDrives = replace(get("drives", 2), "\", "");
    foreach($drive, $usbDrives, "|") {
        if (exists("$drive\$folderName") == 2) {
            run """%programfiles%\Mozilla Firefox\firefox.exe"" -Profile ""$drive\$folderName\afox/""";
            break;
        }
    }

Re: cmd to script?

Posted: 14 Dec 2013 18:03
by yusef88
highend wrote:First usb drive with that folder wins...

Code: Select all

    $folderName = "xy-portable";
    $usbDrives = replace(get("drives", 2), "\", "");
    foreach($drive, $usbDrives, "|") {
        if (exists("$drive\$folderName") == 2) {
            run """%programfiles%\Mozilla Firefox\firefox.exe"" -Profile ""$drive\$folderName\afox/""";
            break;
        }
    }
what I like in your script that "xy-portable" folder must be exists first and doesn't create new one if it's not, so I guarantee don't leave any traces in mistake area. very thanks highend :D

Re: cmd to script?

Posted: 15 Dec 2013 21:11
by yusef88

Code: Select all

"cmd" /k "C:\Program Files\dcrypt\dccon.exe" -mountall
in user defined commands it works but how to run it directly by script

Re: cmd to script?

Posted: 16 Dec 2013 02:00
by binocular222
Run "cmd /k ""C:\Program Files\dcrypt\dccon.exe"" -mountall"

Re: cmd to script?

Posted: 16 Dec 2013 04:21
by yusef88
binocular222, you're the best :D
=======
to whom it may concern

Code: Select all

Run """%programfiles%\Mozilla Firefox\firefox.exe"" -Profile ""<xypath>\afox/"" "
works standalone very well