cmd to script?
-
yusef88
- Posts: 1148
- Joined: 28 Jan 2013 03:50
- Location: Windows 8.1 32-bit
cmd to script?
start firefox.exe -Profile "afox/"
-
yusef88
- Posts: 1148
- Joined: 28 Jan 2013 03:50
- Location: Windows 8.1 32-bit
Re: cmd to script?
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
cmd /K "cd /d ?:\xy portable\"
goto get("driveletter", "data", "?:\xy portable\"); //soft drive letter
-
highend
- Posts: 14940
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: cmd to script?
<xydrive>
Help - Advanced Topics - Variables...
Help - Advanced Topics - Variables...
One of my scripts helped you out? Please donate via Paypal
-
yusef88
- Posts: 1148
- Joined: 28 Jan 2013 03:50
- Location: Windows 8.1 32-bit
Re: cmd to script?
thanks for replay highend
I run xyplorer and firefox in portable mode and use this command to run firefox the batch contain this
is there any possibility to start firefox directly by script? soft drive letter can do any trick in my case?
I run xyplorer and firefox in portable mode and use this command to run firefox
Code: Select all
<xypath>\afox.batCode: Select all
start firefox.exe -Profile "afox/"Code: Select all
get("driveletter", "data", "?:\xy portable\"); //soft drive letterTo see the attached files, you need to log into the forum.
-
binocular222
- Posts: 1423
- Joined: 04 Nov 2008 05:35
- Location: Win11, Win10, 100% Scaling
Re: cmd to script?
Code: Select all
Run """C:\Program Files\firefox.exe"" -Profile afox/"I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488
-
yusef88
- Posts: 1148
- Joined: 28 Jan 2013 03:50
- Location: Windows 8.1 32-bit
Re: cmd to script?
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 itbinocular222 wrote:Note that any switch with space must have double quoteCode: Select all
Run """C:\Program Files\firefox.exe"" -Profile afox/"
-
highend
- Posts: 14940
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: cmd to script?
Where exactly does this profile folder exist? Show the complete folder hierarchy.
One of my scripts helped you out? Please donate via Paypal
-
yusef88
- Posts: 1148
- Joined: 28 Jan 2013 03:50
- Location: Windows 8.1 32-bit
Re: cmd to script?
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
do you get me? 
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\-
binocular222
- Posts: 1423
- Joined: 04 Nov 2008 05:35
- Location: Win11, Win10, 100% Scaling
Re: cmd to script?
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:
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/"" "I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488
-
yusef88
- Posts: 1148
- Joined: 28 Jan 2013 03:50
- Location: Windows 8.1 32-bit
Re: cmd to script?
wow it's working exactly as I want. binocular222 many thanks to you
let's say i have another usb plugged before so it will use it instead the one i work with it
Code: Select all
$USBdrive = trim(get("drives", 2), '\');;
Run """%programfiles%\Mozilla Firefox\firefox.exe"" -Profile ""$USBdrive\xy-portable\afox/"" "-
highend
- Posts: 14940
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: cmd to script?
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;
}
}One of my scripts helped you out? Please donate via Paypal
-
yusef88
- Posts: 1148
- Joined: 28 Jan 2013 03:50
- Location: Windows 8.1 32-bit
Re: cmd to script?
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 highendhighend 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; } }
-
yusef88
- Posts: 1148
- Joined: 28 Jan 2013 03:50
- Location: Windows 8.1 32-bit
Re: cmd to script?
Code: Select all
"cmd" /k "C:\Program Files\dcrypt\dccon.exe" -mountall-
binocular222
- Posts: 1423
- Joined: 04 Nov 2008 05:35
- Location: Win11, Win10, 100% Scaling
Re: cmd to script?
Run "cmd /k ""C:\Program Files\dcrypt\dccon.exe"" -mountall"
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488
-
yusef88
- Posts: 1148
- Joined: 28 Jan 2013 03:50
- Location: Windows 8.1 32-bit
Re: cmd to script?
binocular222, you're the best 
=======
to whom it may concern
works standalone very well
=======
to whom it may concern
Code: Select all
Run """%programfiles%\Mozilla Firefox\firefox.exe"" -Profile ""<xypath>\afox/"" "
XYplorer Beta Club