Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8809951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:00:14+00:00 2026-06-14T03:00:14+00:00

Starting up notepad++ or many other GUI applications in Windows that will accepted fully

  • 0

Starting up notepad++ or many other GUI applications in Windows that will accepted fully qualified filenames of documents on the command line, but which do not accept them if they are not fully qualified, is often done in DOS/Windows batch files like this:

 @echo off
 start "notepad++" "C:\Program Files (x86)\Notepad++\notepad++.exe" %*

The above, if saved as “npp.cmd” will let you type “npp foo.txt” and it will work.
Note that without the npp.cmd, even typing out the full path to the exe, but not fully qualifying the file to edit doesn’t work, like this:

 "C:\Program Files (x86)\Notepad++\notepad++.exe" foo.txt

This however, DOES work:

 "C:\Program Files (x86)\Notepad++\notepad++.exe" c:\users\warren\foo.txt

A way to easily work around this limitation is to make a batch file (.cmd) as shown at the top of this file. I’m learning PowerShell and trying to find the equivalent magic to the “start …. %*” incantation in the batchfile at the top. I believe it would have to be a ‘powershell function’.

Here’s what I have so far:

new-item -path alias:nppapp -value "C:\Program Files (x86)\Notepad++\notepad++.exe"
function npp { nppapp $args }

The above is equivalent, in the end to simply an alias, because $args is really not equivalent to %*, in that it does not do parameter expansion. I think I need something like this:

new-item -path alias:nppapp -value "C:\Program Files (x86)\Notepad++\notepad++.exe"
function npp { nppapp globexpand($args) }

globexpand is of course, a placeholder, for some kind of expansion/globbing routine, which I haven’t been able to find yet in PowerShell.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T03:00:15+00:00Added an answer on June 14, 2026 at 3:00 am

    try this:

    new-item -path alias:nppapp -value "C:\Program Files (x86)\Notepad++\notepad++.exe"
    
    function npp { nppapp (join-path -Path $pwd -ChildPath $args[0]) }
    

    $pwd is an automatic variable with the current working path as value

    Edit:

    function npp { 
    if ($args[0] -match '.:\\.+')
    {
    nppapp $args[0]
    }
    else
    {
    nppapp (join-path -Path $pwd -ChildPath $args[0]) }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some code for starting a process (notepad), and dynamically makes a event
We have a launcher app that does some setup (starting a server), launches a
Starting the development of my android app,that uses Maps API, I didn't know that
starting with InDesign CS 5, there is a new format, called IDML , that
I'm considering writing a new Windows GUI app, where one of the requirements is
I am writing a program that must register time of starting a process such
Looking at the Android tutorials such as the Notepad tutorial , I noticed that
I'm new to Windows API programming. I am aware that there are ways to
I'm learning how to make and run Java programs in Windows with Notepad and
Intention Using the following code, I managed to load some applications in my windows

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.