Jump to content

Recommended Posts

Posted

this just started with notepad++ v8.6.9 and continued with v8.7

I use auto-it to open a txt file, and notepad++ opens the file but with "Folder as Workspace" field open

Things I've tried thus far

ShellExecute("$txtFile$")
Run('"C:\Program Files\Notepad++\notepad++.exe" "$txtFile$"')
Run('"' & @ComSpec & '" /c "$txtFile$"', '', @SW_HIDE)
Run("$txtFile$")

Unchecking "Open all files of folder instead of launching Folder as Workspace on folder dropping"

I don't use "Folder as Workspace" and wish to COMPLETELY disable it

FaS-Notepad.png

Posted

 

; https://www.autoitscript.com/forum/topic/212349-autoit-opens-notepad-with-folder-as-workspace-open/?do=findComment&comment=1537467

#cs
    ---------------------------
    Notepad++ Command Argument Help
    ---------------------------
    Usage :

    notepad++ [--help] [-multiInst] [-noPlugin] [-lLanguage] [-udl="My UDL Name"] [-LlangCode] [-nLineNumber] [-cColumnNumber] _
    [-pPosition] [-xLeftPos] [-yTopPos] [-monitor] [-nosession] [-notabbar] [-ro] [-systemtray] [-loadingTime] [-alwaysOnTop] _
    [-openSession] [-r] [-qn="Easter egg name" | -qt="a text to display." | -qf="D:\my quote.txt"] [-qSpeed1|2|3] [-quickPrint] _
    [-settingsDir="d:\your settings dir\"] [-openFoldersAsWorkspace]  [-titleAdd="additional title bar text"][filePath]

    --help : This help message
    -multiInst : Launch another Notepad++ instance
    -noPlugin : Launch Notepad++ without loading any plugin
    -l : Open file or Ghost type with syntax highlighting of choice
    -udl="My UDL Name": Open file by applying User Defined Language
    -L : Apply indicated localization, langCode is browser language code
    -n : Scroll to indicated line on filePath
    -c : Scroll to indicated column on filePath
    -p : Scroll to indicated position on filePath
    -x : Move Notepad++ to indicated left side position on the screen
    -y : Move Notepad++ to indicated top position on the screen
    -monitor: Open file with file monitoring enabled
    -nosession : Launch Notepad++ without previous session
    -notabbar : Launch Notepad++ without tabbar
    -ro : Make the filePath read only
    -systemtray : Launch Notepad++ directly in system tray
    -loadingTime : Display Notepad++ loading time
    -alwaysOnTop : Make Notepad++ always on top
    -openSession : Open a session. filePath must be a session file
    -r : Open files recursively. This argument will be ignored
         if filePath contain no wildcard character
    -qn="Easter egg name": Ghost type easter egg via its name
    -qt="text to display.": Ghost type the given text
    -qf="D:\my quote.txt": Ghost type a file content via the file path
    -qSpeed : Ghost typing speed. Value from 1 to 3 for slow, fast and fastest
    -quickPrint : Print the file given as argument then quit Notepad++
    -settingsDir="d:\your settings dir\": Override the default settings dir
    -openFoldersAsWorkspace: open filePath of folder(s) as workspace
    -titleAdd="string": add string to Notepad++ title bar
    filePath : file or folder name to open (absolute or relative path name)
#CE


Local $sFilePath = @ScriptFullPath                                           ; * <-- give here the txtFile path
Local $sExec = "D:\i\PortableApps\Notepad++Portable\Notepad++Portable.exe"   ; * <-- give here the NPP executable path

; -nosession : Launch Notepad++ without previous session
Local $sCmd = '"' & $sExec & '" "' & $sFilePath & '" -nosession'
ConsoleWrite("$sCmd=" & $sCmd & @CRLF)

Run($sCmd)

 

I know that I know nothing

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...