If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Rate Thread | Display Modes |
#1
|
|||
|
|||
.bat on taskbar?
Hi All,
Windows 7 Pro, SP1, 32 bit I created a Perl6 program for a customer. I created a shortcut to it on the desktop. But Windows won't allow me to to copy it to the task bar as perl6 is a batch file. Looking at google, the trick of creating cmd /c perl6 program.pl6 on the desktop and dragging it to the task bar, did not work either Any word of wisdom? -T |
Ads |
#2
|
|||
|
|||
.bat on taskbar?
On 05/04/2018 01:20 PM, T wrote:
Hi All, Windows 7 Pro, SP1, 32 bit I created a Perl6 program for a customer.Â* I created a shortcut to it on the desktop.Â* But Windows won't allow me to to copy it to the task bar as perl6 is a batch file. Looking at google, the trick of creating Â*Â*Â*Â*Â*Â*Â*Â*Â* cmd /c perl6 program.pl6 on the desktop and dragging it to the task bar, did not work either Any word of wisdom? -T It seams that it does not like "cmd.exe" |
#3
|
|||
|
|||
.bat on taskbar?
On 05/04/2018 04:20 PM, T wrote:
Hi All, Windows 7 Pro, SP1, 32 bit I created a Perl6 program for a customer.Â* I created a shortcut to it on the desktop.Â* But Windows won't allow me to to copy it to the task bar as perl6 is a batch file. Looking at google, the trick of creating Â*Â*Â*Â*Â*Â*Â*Â*Â* cmd /c perl6 program.pl6 on the desktop and dragging it to the task bar, did not work either Any word of wisdom? -T Put it on the menu by copying it in C:\Users\name\AppData\Roaming\Microsoft\Windows\St art Menu\Programs and then open the Windows start menu (bottom left corner icon) and find it and right click and "add to task bar" ? maybe? |
#4
|
|||
|
|||
.bat on taskbar?
On 05/04/2018 02:57 PM, Big Al wrote:
On 05/04/2018 04:20 PM, T wrote: Hi All, Windows 7 Pro, SP1, 32 bit I created a Perl6 program for a customer.Â* I created a shortcut to it on the desktop.Â* But Windows won't allow me to to copy it to the task bar as perl6 is a batch file. Looking at google, the trick of creating Â*Â*Â*Â*Â*Â*Â*Â*Â*Â* cmd /c perl6 program.pl6 on the desktop and dragging it to the task bar, did not work either Any word of wisdom? -T Put it on the menu by copying it in C:\Users\name\AppData\Roaming\Microsoft\Windows\St art Menu\Programs and then open the Windows start menu (bottom left corner icon) and find it and right click and "add to task bar" ?Â*Â* maybe? All I can do it "send to desktop". No pin options in the context menu. Rats! Thank you anyway! -T |
#5
|
|||
|
|||
.bat on taskbar?
On 05/04/2018 01:20 PM, T wrote:
Hi All, Windows 7 Pro, SP1, 32 bit I created a Perl6 program for a customer.Â* I created a shortcut to it on the desktop.Â* But Windows won't allow me to to copy it to the task bar as perl6 is a batch file. Looking at google, the trick of creating Â*Â*Â*Â*Â*Â*Â*Â*Â* cmd /c perl6 program.pl6 on the desktop and dragging it to the task bar, did not work either Any word of wisdom? -T Tried using what the bat file used and that did not work either (the shortcut did): C:\rakudo\bin\moar.exe --execname="%~dpf0" --libpath="C:\rakudo\share\nqp\lib" --libpath="C:\rakudo\share\perl6\lib" --libpath="C:\rakudo\share\perl6\runtime" C:\rakudo\share\perl6\runtime\perl6.moarvm C:\NtUtil\RemoveMargin.pl6" |
#6
|
|||
|
|||
.bat on taskbar?
T wrote:
Windows 7 Pro, SP1, 32 bit I created a Perl6 program for a customer. I created a shortcut to it on the desktop. But Windows won't allow me to to copy it to the task bar as perl6 is a batch file. Looking at google, the trick of creating cmd /c perl6 program.pl6 on the desktop and dragging it to the task bar, did not work either "Copy to the taskbar". Not sure what you mean. Are you trying to pin a program to the Windows taskbar? If so, there are restrictions on filetypes supported for pinning. You can pin shortcuts (that point to ..bat file) to the Windows taskbar. You cannot pin .bat files to the Windows taskbar. You can always use or add toolbars to the Windows taskbar. I don't like pinning and instead use shortcuts in toolbars: QuickLaunch toolbar (which I had to create since Win7 didn't include an install-time one), toolbar for web browsers, toolbar for e-mail and other communications, a utility toolbar, and the addressbar toolbar. I can add shortcuts to ..bat files in any toolbar in the Windows taskbar. While you can run a .bat file pointed to by a shortcut (.lnk file), you can also specify commands to run in the shortcut, and you can even specify multiple commands. You can pin shortcuts to the Window taskbar (or put them into toolbars in the Windows taskbar). Create a shortcut on the desktop that runs: cmd.exe /c "perl6 program.pl6" If perl6.exe is not in the PATH environment variable (already defined for use in the new command shell), you will either need to include a path to it in the command string or specify the target folder ad the default one in which to start the command shell. You may also have to specify the path to the .pl6 file. Depends on how the Perl interpreter can locate its script files. Notice that I enclosed the *command* spec of cmd.exe within double-quotes. You need to tell cmd.exe what is the command -- and you have spaces in your command argument. Run "cmd /?" in an existing command shell and notice what is its syntax. All it shows is "string" as the command for the shell to run. Think about how to parse the arguments. You want "perl6 program.pl6" to specify the ONE argument for "string" that cmd.exe will run. That alone might be your problem. While most users only run one command per shortcut, it is possible to run multiple commands. Delimit each command with & (ampersand) to make execution non-conditional (every command gets executed regardless what happened for any one command) and && (double ampersand) to run the commands conditionally (the next command runs only if the return status was zero/OK from the prior command). For example, you could run: dir c:\ /s filelist.txt && notepad.exe filelist.txt This does a directory listing, dumps stdout into a file, and then loads that file into Notepad. There's no point in loading Notepad unless the prior dir command returned an okay status (errorlevel = 0). In your case, you only showed running a single command. I just mentioned the ampersands for information should you have a short set of commands that you could execute just by using a shortcut instead of creating a .bat file that the shortcut calls. |
#7
|
|||
|
|||
.bat on taskbar?
On 05/04/2018 08:25 PM, VanguardLH wrote:
T wrote: Windows 7 Pro, SP1, 32 bit I created a Perl6 program for a customer. I created a shortcut to it on the desktop. But Windows won't allow me to to copy it to the task bar as perl6 is a batch file. Looking at google, the trick of creating cmd /c perl6 program.pl6 on the desktop and dragging it to the task bar, did not work either "Copy to the taskbar". Pin to the task bar Not sure what you mean. Are you trying to pin a program to the Windows taskbar? If so, there are restrictions on filetypes supported for pinning. You can pin shortcuts (that point to .bat file) to the Windows taskbar. You cannot pin .bat files to the Windows taskbar. Create a shortcut on the desktop that runs: cmd.exe /c "perl6 program.pl6" This the favorite on Google: I does not work for me. If perl6.exe is not in the PATH environment variable (already defined for use in the new command shell), It is. The exact run sting is: "%comspec% " /K C:\rakudo\bin\perl6.bat C:\NtUtil\RemoveMargin.pl6 && exit "%comspec% " /C C:\rakudo\bin\perl6.bat C:\NtUtil\RemoveMargin.pl6 Does not work either. I got the first one to pin once. Then it refused afterwards. |
#8
|
|||
|
|||
.bat on taskbar?
On 05/05/2018 05:13, T wrote:
"%comspec% " /K C:\rakudo\bin\perl6.bat C:\NtUtil\RemoveMargin.pl6 && exit "%comspec% " /C C:\rakudo\bin\perl6.bat C:\NtUtil\RemoveMargin.pl6 Does not work either. I got the first one to pin once.Â* Then it refused afterwards. Why is there a space between the end of %ComSpec% and the closing quote? Is that your problem? I have two DOS/CMD prompts open at the moment. If I rt-click the TaskBar button of either, I have the option "Pin this program to taskbar" |
#9
|
|||
|
|||
.bat on taskbar?
[]
I have two DOS/CMD prompts open at the moment. If I rt-click the TaskBar button of either, I have the option "Pin this program to taskbar" That'll give you a pinned shortcut (is shortcut the right term?) to the command prompt; I have one, whose Target line is "%SystemRoot%\system32\cmd.exe" [without the ""]. It wouldn't give you s shortcut to a batch file. However, maybe you could add the name of a batch file _to_ its target line. [Maybe needing some "", perhaps even nested.] Incidentally, I found I had to right-click _twice_ to get to the Target line: the first one just brings up a two-line menu, containing "Command Prompt" and "Unpin this program from task bar". Right-clicking _on_ the first one brings up another menu that includes Properties, which brings up the normal properties of a shortcut. Checking with my other "pinned" shortcuts (?), this seems to be how they all behave - some pop up something with more than two lines (some of them adding sections labelled Tasks or Frequent), but those two are always there at the bottom, and Properties is never there until you do the next right-click on the upper of the two. (I haven't "played" with pinned "shortcuts" before; it seems they aren't _that_ different to normal ones though.) -- J. P. Gilliver. UMRA: 1960/1985 MB++G()AL-IS-Ch++(p)Ar@T+H+Sh0!:`)DNAf No, I haven't changed my mind - I'm perfectly happy with the one I have, thank you. |
#10
|
|||
|
|||
.bat on taskbar?
On 05/05/2018 03:26 AM, Java Jive wrote:
On 05/05/2018 05:13, T wrote: "%comspec% " /K C:\rakudo\bin\perl6.bat C:\NtUtil\RemoveMargin.pl6 && exit "%comspec% " /C C:\rakudo\bin\perl6.bat C:\NtUtil\RemoveMargin.pl6 Does not work either. I got the first one to pin once.Â* Then it refused afterwards. Why is there a space between the end of %ComSpec% and the closing quote? Â*Is that your problem? Doesn't effect it I have two DOS/CMD prompts open at the moment.Â* If I rt-click the TaskBar button of either, I have the option "Pin this program to taskbar" I can do the same. I get blocked after I add anything to the cmd.exe run line |
#11
|
|||
|
|||
.bat on taskbar?
On 05/05/2018 03:58 AM, J. P. Gilliver (John) wrote:
"%SystemRoot%\system32\cmd.exe" and %comspec% are the same thing |
#12
|
|||
|
|||
.bat on taskbar?
On 05/05/2018 03:58 AM, J. P. Gilliver (John) wrote:
[] I have two DOS/CMD prompts open at the moment.Â* If I rt-click the TaskBar button of either, I have the option "Pin this program to taskbar" That'll give you a pinned shortcut (is shortcut the right term?) to the command prompt; I have one, whose Target line is "%SystemRoot%\system32\cmd.exe" [without the ""]. It wouldn't give you s shortcut to a batch file. However, maybe you could add the name of a batch file _to_ its target line. [Maybe needing some "", perhaps even nested.] Incidentally, I found I had to right-click _twice_ to get to the Target line: the first one just brings up a two-line menu, containing "Command Prompt" and "Unpin this program from task bar". Right-clicking _on_ the first one brings up another menu that includes Properties, which brings up the normal properties of a shortcut. Checking with my other "pinned" shortcuts (?), this seems to be how they all behave - some pop up something with more than two lines (some of them adding sections labelled Tasks or Frequent), but those two are always there at the bottom, and Properties is never there until you do the next right-click on the upper of the two. (I haven't "played" with pinned "shortcuts" before; it seems they aren't _that_ different to normal ones though.) Well that worked. I did a search on cmd, then pinned it to the task bar. I rt clicked on the taskbar icon, then rt clicked again on Command Prompt, selected Properties, and altered the shortcut. The only thing I can't get it to do now is use the icon I specified. Thank you! |
#13
|
|||
|
|||
.bat on taskbar?
On 05/05/2018 05:41 AM, T wrote:
On 05/05/2018 03:58 AM, J. P. Gilliver (John) wrote: [] I have two DOS/CMD prompts open at the moment.Â* If I rt-click the TaskBar button of either, I have the option "Pin this program to taskbar" That'll give you a pinned shortcut (is shortcut the right term?) to the command prompt; I have one, whose Target line is "%SystemRoot%\system32\cmd.exe" [without the ""]. It wouldn't give you s shortcut to a batch file. However, maybe you could add the name of a batch file _to_ its target line. [Maybe needing some "", perhaps even nested.] Incidentally, I found I had to right-click _twice_ to get to the Target line: the first one just brings up a two-line menu, containing "Command Prompt" and "Unpin this program from task bar". Right-clicking _on_ the first one brings up another menu that includes Properties, which brings up the normal properties of a shortcut. Checking with my other "pinned" shortcuts (?), this seems to be how they all behave - some pop up something with more than two lines (some of them adding sections labelled Tasks or Frequent), but those two are always there at the bottom, and Properties is never there until you do the next right-click on the upper of the two. (I haven't "played" with pinned "shortcuts" before; it seems they aren't _that_ different to normal ones though.) Well that worked.Â* I did a search on cmd, then pinned it to the task bar.Â* I rt clicked on the taskbar icon, then rt clicked again on Command Prompt, selected Properties, and altered the shortcut. The only thing I can't get it to do now is use the icon I specified. Thank you! Thank you all for the help! Okay, here is what I got so far. 1) desktop 2) create shortcut: %comspec% Do not rename the shortcut or pinning to the taskbar will fail 3) change the new shortcuts icon 4) pin to the taskbar 5) Right Clink on the taskbar icon on the pop up, right click again on Properties 6) add after %comspec% what you need on the command line. For example: "%comspec%" /C C:\rakudo\bin\perl6.bat C:\NtUtil\RemoveMargin.pl6 The only thing missing is the icon's name, which I haven't figured out how to change yet |
#14
|
|||
|
|||
.bat on taskbar?
On 05/05/2018 13:31, T wrote:
On 05/05/2018 03:26 AM, Java Jive wrote: I have two DOS/CMD prompts open at the moment.Â* If I rt-click the TaskBar button of either, I have the option "Pin this program to taskbar" I can do the same.Â* I get blocked after I add anything to the cmd.exe run line One of my DOS Prompts already had stuff after the CMD to launch a *.BAT file to initialise the environment, yet it still pins to the TaskBar, and from there launches the DOS Prompt and initialises it correctly. |
#15
|
|||
|
|||
.bat on taskbar?
In message , T writes:
On 05/05/2018 03:58 AM, J. P. Gilliver (John) wrote: "%SystemRoot%\system32\cmd.exe" and %comspec% are the same thing Thanks, useful to know. I was just quoting a previous poster. -- J. P. Gilliver. UMRA: 1960/1985 MB++G()AL-IS-Ch++(p)Ar@T+H+Sh0!:`)DNAf Being punctual makes people think you have nothing to do. |
|
Thread Tools | |
Display Modes | Rate This Thread |
|
|