I am using windows source insight. In this only the basic text editor is available. Is there any vim plugin available to use it in windwos source insight?
According to the docs (search for ShellExecute), you should be able to invoke a ShellExecute with an arbitrary program. If VIM is associated with a certain file as editor, this should work:
ShellExecute edit <yourfile>
If VIM is for some strange reason not the default editor for a certain file, you should try
ShellExecute "" C:/Path/to/vim.exe <yourfile>
Thay way, you should be able to call any external tool from Source Insight.
add customer command in source insight and bind a new short key.
"C:\Program Files (x86)\Vim\vim81\gvim.exe" --remote-silent +%l %f
Related
I can't figure out how to start the OneNote UWA from Windows command-line. The best I could do is find where it's installed. However, I don't know how to actually start it up from the command-line; as, the executables in that directory don't start OneNote UWA.
C:\Program Files\WindowsApps\Microsoft.Office.OneNote_16001.11901.20096.0_x64__8wekyb3d8bbwe
PS: I tried to use the same command-line that's in Windows TaskManager (below). However, the app doesn't startup nor does it give an error; even with elevated privileges.
"C:\Program Files\WindowsApps\Microsoft.Office.OneNote_16001.11901.20096.0_x64__8wekyb3d8bbwe\onenoteim.exe" -ServerName:microsoft.onenoteim.AppXxqb9ypsz6cs1w07e1pmjy4ww4dy9tpqr.mca
I'd really appreciate any help suggestions to do this. If this is not possible (or nobody knows the answer, I would also be happy if someone knows how to associate a global hotkey to OneNote UWA.
I followed this tutorial and it worked great for me:
Launch Metro app from command line
my resultant command was this:
explorer.exe shell:AppsFolder\Microsoft.Office.OneNote_8wekyb3d8bbwe!microsoft.onenoteim
which launched into OneNote (metro/winrt/uwa version and not the desktop version)
There is a shortcut you can do that would have worked in my case. When you look at the target of the shortcut you create... instead use this command line tool to get the full target (since you can't copy from the target box in the shortcut properties window) and then use this instead:
explorer.exe shell:<target value>
get the command line tool here:
LNK file parser
careful though because the value wraps when you use the LNK file parser in a command window. You can output the result text from lnk_parser_cmd to a text file to ensure you get the correct value. Their example is:
lnk_parser_cmd.exe shortcut.lnk
you would simply use:
lnk_parser_cmd.exe shortcut.lnk > result.txt
and then you can easily copy and paste the non-wrapped text from result.txt.
Does Powershell have the capacity to generate some kind of terminal-based text editor program? I am switching to Windows because it supports a few programs I can't use otherwise; but I am having trouble discovering some sort of way to edit text files directly from Powershell. Is it possible to create a terminal-based text editor with a Powershell script; and if not is there a simple alternative?
Why don't you just install Vim, as it has a Windows version too? Add it to path and you should be all set.
I would suggest micro which is a powershell/ cmd/ terminal based text editor for Windows and other OS
https://micro-editor.github.io/
Because micro is flexible cut/copy/paste same keyboard shortcut as notepad. The best part is, it has color highlighter sensitive to programming language. Here is an image
Note: don't forget the add the micro.exe path to environment variable.
Command to open a file from cmd:
micro ./file.xyz
You use chocolately if it is installed on your powershell if you don’t have it just search for it online
Choco install nano
After this you can use nano
Then just
nano filenam
If it exists it edit it and if it doesn’t it create a new file
I'm trying to create a .cfg file for bcc32 compiler and I'm following the instructions. I have installed correctly and placed an environment path as instructed but when I type "edit bcc32.cfg" into the command prompt it says that edit isn't a valid command? What am I supposed to do?
You could also create a .bat file, edit.bat, to replace the 16-bit edit program (removed because x64 windows flavors won't run it) which would launch your favorite editor.
#echo off
notepad %1
#echo on
This is what I wound up doing as a simple patch so I could carry on the way I always had for the most part. Just type:
edit myfile.ext
in the command prompt to use it.
Note: notepad is not my favorite editor - this is just an example that will work with stock windows.
Note 2: #echo off and #echo on are shown for clarity. You may also shorten this by omitting the echo statements and simply placing the # before the command to be silenced.
#notepad %1
I just use notepad (since they took out the edit command) from the command window like so:
C:\Borland\BCC55\bin> notepad bcc32.cfg
The file will open in notepad for editing. When you've finished editing the file, save it and you're done.
I have found this works for seeing in-window text of a complete file, on a 64bit machine. Once your path is set in cmd prompt, type the word type... followed by "filename" do you see how I used the quotes around the filename only!
type "filename"
You type it just like this (changing filename for your files name) and you will be able to see the entire file text in the cmd window. Not sure how to edit from here on but maybe someone can figure it out from here and tell me.
Assuming you're using Windows 7 (where edit.exe and edlin.exe have been removed):
Use powershell.exe instead of cmd - thereby edit will be available via command line.
Take a look at: http://en.wikipedia.org/wiki/Windows_PowerShell
simple answer....
if your using an old version of windows (xp e.t.c...) you would be able to use edit
but since your using new version of windows, Microsoft has updated and removed the commands that they think are not relevant e.g.. (msg, edit) depending if its a bit32 bit64 or bit82...
I currently have a perl program in Windows that creates and populates an excel file via Spreadsheet::WriteExcel, but I'd like to have that file opened as my program closes. I tried googling for information, but all I found was how to open and read excel files within perl. Would anyone be able to help me?
I recommend this:
`your_file.xls`;
It just executes a system command. Assuming Excel files are set to default open with Excel, this will work (adding the full path to the file may or may not be necessary, depending on your setup).
Other options:
system("your_file.xls");
`C:\\Program Files\\...\\excel.exe your_file.xls`;
system("C:\\Program Files\\...\\excel.exe your_file.xls");
I would use Win32::OLE for this. OLE is the Office extensions that you can use to perform tasks with the applications. This example should work (I haven't tested it):
use strict;
use warnings;
use Win32::OLE;
use Win32::OLE::Const 'Microsoft Excel';
my $excel = Win32::OLE->GetActiveObject('Excel.Application')
|| Win32::OLE->new( 'Excel.Application', 'Quit' );
$excel->{Visible} = 1;
If you end up going down this route, here's a reference to the Excel 2007 commands.
The following works for me. It does not require using any additional module(s).
system "start excel $file";
you can use the exec command in Perl like this:
my $excel_file = "file.xlsx";
exec "cmd", "/c", "start", $excel_file;
This will open the default program in your system to open xlsx files.
I like this option because if the user does not have excel installed, only libreoffice (for example), the system will open the file with libreoffice.
I need this to be able to ask the user for a file, then after the user chooses one, it will run a CMD command like "program.exe [selected file]"
If you're asking for a way to have a batch script create an open file dialog, I don't believe that's possible. You're better off creating a small program that will do this for you.
There might be a way, but I don't know it. I'm going to cover some alternatives.
GUIs work mostly by attaching commands to files, not the other way around. You can do that using file extensions. You can do that using Send To.
File extensions permit the association of an command (e.g. perl) with a file extension (e.g. .pl) Using "assoc" and "ftype", one associates the name to an extension, and a command to that name.
I'm not at my Windows machine at the moment, so I can't give you the exact usage. Type "help assoc" and "help ftype" at the prompt for usage. Use "%1" (quote included) in the command to indicate where the name of the clicked file should appear in the command.
Whenever you double-click on a file with that extension, it will be launched in with your command.
Alternatively, you can use "Send To". Somewhere in your profile is a directory named "Send To". (Just do a search to find it.) Put a shortcut to the application in there. To use the shortcut, right-click on the file you want to open, choose Send To, choose the application.
Eric
Check out the cmd command (the modern version of the DOS command line on Windows), which can invoke itself recursively. The command-line options are available by typing cmd /? at a command prompt.