Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^3: [implementation specific to windows] writing a proper batch file for terminal start-up

by marto (Archbishop)
on Oct 19, 2019 at 08:44 UTC ( #11107685=note: print w/replies, xml ) Need Help??


in reply to Re^2: [implementation specific to windows] writing a proper batch file for terminal start-up
in thread [implementation specific to windows] writing a proper batch file for terminal start-up

"I seem to have come up short in a command prompt in administrator mode:"

The examples you link to instruct you to open a command prompt, you have executed this in a power shell session, not a command prompt. I find it simpler, more productive and more portable just to open up a a command prompt and run the programs from there, after the initial setup. If you are using a fancy IDE it may already have such functionality available.

Update: typo excited/executed, autocorrect...

  • Comment on Re^3: [implementation specific to windows] writing a proper batch file for terminal start-up

Replies are listed 'Best First'.
Re^4: [implementation specific to windows] writing a proper batch file for terminal start-up
by Aldebaran (Chaplain) on Oct 21, 2019 at 19:25 UTC
    The examples you link to instruct you to open a command prompt, you have [executed] this in a power shell session, not a command prompt.

    I repeated and found the command prompt that opened as admin. The commands accepted the syntax, but it did not seem to change the behavior of windows when a .pl file was thereafter double-clicked on. In settings, I changed the default app to open to be notepad++, which is probably the best outcome anyways. They don't want to let you open files with programs that you have rolled yourself but that it fit into the app world. I felt very uncomfortable in both the power shell and the admin shell. If it's not a one and done, then I don't want to do it again.

    I find it simpler, more productive and more portable just to open up a a command prompt and run the programs from there, after the initial setup.

    Indeed, what I *really, really* miss is the ability in ubuntu to right click and "open terminal here." Right now, I *can* get a terminal to open on right-click, but it's the bash terminal from Git, and it's a whole different animal than a dos terminal. I really feel like I crawl around with dos. It's one of the reasons that I find myself always returning to 'nix systems. I heard about a Raspberry Pi at a social event this weekend and can't wait to get one.

    I would like to thank everyone for taking the time to address these implementation-specific issues. Speaking only for me, I wouldn't understand anything about contemporary Windows without perl. Here is my latest startup script,

    C:\Users\tblaz\Documents\evelyn>type 3.startup.bat @echo off rem set env variables set TERM=dumb set PERL_JSON_BACKEND=JSON::XS set PERL_YAML_BACKEND=YAML rem avoid collisions with other perl stuff on your system rem set PERL5LIB= set PERL5OPT= set PERL_MM_OPT= set PERL_MB_OPT= perl -e "printf("""Perl executable: %%s\nPerl version : %%vd\n""", $ +^X, $^V)" 2>nul if ERRORLEVEL==1 echo.&echo FATAL ERROR: 'perl' does not work; check i +f your strawberry pack is complete! rem a couple things that didn't quite work...privileges a problem rem assoc .pl=PerlScript rem ftype PerlScript=C:\Strawberry\perl\bin\perl.exe "%1" %* cd C:\Users\tblaz\Documents\evelyn\ perl 8.monktag.pl C:\Users\tblaz\Documents\evelyn>

    This is probably good enough for now.

      Windows right-click (tangent):

      what I *really, really* miss is the ability in ubuntu to right click and "open terminal here."

      open command window here should help you get the equivalent enabled in Windows. I additionally create an "Open this File's Directory" to the RClick menu for every file type by doing the following from a .reg file:

      Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\Classes\*\shell\OpenThisFilesDirectory] @="Open This File's Directory" "Icon"="%SystemRoot%\\system32\\cmd.exe" [HKEY_CURRENT_USER\Software\Classes\*\shell\OpenThisFilesDirectory\com +mand] @="cmd.exe /s /k pushd \"%W\""

      Running that reg file builds the following key/value/data set:

      HKCU\Software\Classes\*\shell\OpenThisFilesDirectory (Default) [REG_SZ] = Open This File's Directory Icon [REG_SZ] = %SystemRoot%\system32\cmd.exe HKCU\Software\Classes\*\shell\OpenThisFilesDirectory\command (Default) [REG_SZ] = cmd.exe /s /k pushd "%W"

      (edit: s/\Q[tangent]\E/(tangent)/)

        Works like a charm pyryt. Thanks.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11107685]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (8)
As of 2019-12-10 23:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?