Clear recently used programs from Windows 7 start menu - powershell

Does anyone know a way to clear MRU start menu programs on windows 7 using powershell? I saw a way using a registry edit, but I would prefer if at all possible to avoid that.

If you want to clear recent programs list (one that appears when the start button is pressed), here are your options:
1) Use the following Powershell script and restart Explorer (credit goes here):
del HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist
2) Because you also said disabling recent programs list works for you, here are the two ways to do it:
Using a REG File Download (see above link).
Through the Local Group Policy Editor (I would recommend this one).
And this is just another useful article that covers related topics and explains how it works in detail:
Clear recently used programs in Start Menu in Windows 7.

Related

Powershell won't pass keystroke to cli window

I first need to offer the disclaimer that I am barely a novice when it comes to scripting or coding, so I might be doing this all wrong in the first place. I'm running into an issue with a script I had written in powershell a while ago that is used on several hundred computers in my company daily to automate starting a certain app that everyone uses. So far everyone else hasn't had an issue except one machine.
Normally when I run the script, it starts the services and cli for the program which opens in a new window. Then the script, still open behind that, sends all of the key commands to that cli window, pauses for a brief line of user input after which it closes that cli window, does a few other clean up tasks and closes out itself.
The only difference on this one machine that's not working is the script won't pass the keystrokes to the cli window. If I put them in manually including the normal user input, it finishes the rest of the script just fine, but the cli window is just not receiving the keystroke input from the main script.
The only part of the script that send the keystrokes to the cli window is a few lines of this:
[System.Windows.Forms.SendKeys]::SendWait("Text{Enter}")
I have tried using the sleep command before and in between the key commands to make sure it's not going through the keystrokes to early. I've checked and windows had gone through an Update two days ago, but we would've heard about this issue right then if that was it. I'm at a loss for what the issue could be and would apreciate and help, tips, or direction to help figure this one out.
Is the console window the active window when the keys are sent? The documentation for the class you are calling indicates that it sends the keys to the active window. Not only that, but the documentation also seems to indicate that there are some issues that developers have run into when using that class to sends keys. I would try using the autoit powershell module instead. Autoit is its own scripting language which specializes in automating windows processes and being capable of automating interactions with windows forms, but also comes bundled with its own powershell module that I think is exactly what you need, so I would download the portable "zip" package, extract the powershell module from "Autoitx", and that should help you accomplish what you need
PowerShell automation especially when using SendKeys can / is glitchy due to many varying reasons. Can you use SendKeys sure, but you have to know the environment it will be run in and the needed performance details. Hence your futzing/guessing with Sleep.
There are purpose-built tools to help.
Auto HotKey
'PowerShell auto hotkey'
or the UIAutomation tool
'PowerShell automating other applications'

Command line switches for CWBTF.EXE aka Data Transfer From IBM i..?

I would like to add an Edit action to the right-click context menu for IBM *.DTF files in my Windows Registry.
What are the command lines switches for CWBTF.EXE..? Is there a switch for "open DTF file for editing" (but do not run it)..?
I've searched Google, StackOverflow, and the the IBM i 7.3 documentation for any mention of the command line switches for CWBTF.EXE aka "Data Transfer From IBM i", but I've found none.
The shortcut on my Windows Start Menu for "Data Transfer From IBM i" has the /t switch, but I cannot find any information on this.
I did find the command-line transfer utility RTOPCB.EXE, which does have some /? help text, but the options did not seem to relate much to the full-GUI version CWBTF.EXE.
I'm not sure where the documentation on the old Client Access program (CWBTF.EXE) exists. However, if you are able to use the newer Java based Access Client Solutions, the documentation for scripting can be found here. In particular, look for /plugin=download for transfer from IBM i.
I don't know if there are command-line switches which will override the "run automatically" setting. It seems unlikely. But depending on how determined you are, and how comfortable you are with scripting, a workaround could be to write your own CWBTF.EXE wrapper in a scripting language of your choice.
In broad strokes, your wrapper would go ahead and modify the .dtf file (or a copy of it) to ensure AutoRun=0 appears in the [Properties] section. Then it would call CWBTF.EXE on the modified .dtf. Then after that, if it's well-behaved, it would restore the .dtf to its original state (or remove the altered copy).
Armed with such a script, you could associate Edit with the wrapper.

Is drag-and-drop to open a file possible in VSCode?

I am wondering if something is wrong with my computer (or myself), because I can't seem to drag & drop a file into Visual Studio Code to open it in the editor. Closing an opened folder first doesn't make a difference. VSCode always shows me the 'stop sign', in every spot I tried (the editor, the opened tab bar, an existing opened file, ...).
Why does VSCode block this ?
(I have experienced this in earlier versions as well. Currently on v1.6 on Windows 7.)
Searching for a solution, I stumbled on this page, where one commenter explains:
I think you are running into the security issue where lower permission processes cannot send messages to higher permission processes. Explorere.exe, running at normal permission levels, cannot send the window message to winword.exe, running elevated.
I am indeed always running VSCode as Administrator, but not my Explorer windows.
When I run VSCode in non-administrator mode (so just my regular user), drag-and-drop works fine.
I feel silly as I lost 15 minutes looking into this. In case it helps:
Make sure you are not trying to open files from a zip file...
Cheers.

Interactive Perl programming in Sublime 3 (Ubuntu)

Practically all of the exercises in my introductory Perl book have so far required taking input, which is causing me some challenges with Sublime Text 3. I set up the custom build file from this post to run scripts directly and I've also installed REPL on top of that, but I'm still unable to provide input through the bottom console.
Is there a way to enable input for scripts built via Ctrl+B, preferably with the console messages getting a little less in the way? I'm currently stuck with having to fire up the terminal every time, which doesn't make for a particularly smooth learning experience.
This doesn't really help you with your Sublime issue, but you mention firing up a terminal every time isn't helping you learn - here's the way I do it when I'm either learning or rapidly prototyping: Simply setup a folder on your local machine, called sync or something. Create a similar folder on your terminal server.
Now use an app (I use WinSCP and use Keep Remote Directory Up To Date setting) to sync. Every time you press save in your text editor, the new script is automatically uploaded to your terminal server, you can now just alt+tab to your terminal and run the script. Works very well for me and enabled really easy rapid prototyping.

Matlab : open OS explorer window only if not already open

I'm opening a folder in Windows explorer from within matlab with the following line :
system('explorer.exe /select,./my_folder/my_file.tif');
It works well, even with the relative path for Matlab "current folder" with "./". Note that it also selects the specified file, which is what I want.
However, I would like to open this window only if the same path isn't already open. Right now, I get several copies of the same window and it's annoying. Do you know any way to do this ?
Thanks,
Ghislain
(Windows 8, Matlab R2011b 64bits)
Disclaimer
This is a partial answer. I don't know how to go on from here, but maybe it helps anyways. Your question is quite interesting to me, and it would make data-analysis a lot easier if changing between interfaces (Matlab/Explorer) were easier!
Some History
DDE is an ancient technology (16-bit Windows, yeah!) that enables Windows applications to talk to each other. DDE has been deperecated from Windows XP on, but it simply refuses to die.
One reason for DDE's longevity is that Windows Explorer still uses DDE a lot. For example, when you double-click a file, the Explorer sends a DDE command to Excel, telling it to open that file in the current Excel window.
How DDE might help you
Matlab's DDE support is officially deprecated. Maybe it would have disappeared completely, were it not for the fact that Explorer talks to Matlab via DDE messages!
You can reverse this process by telling initiating a DDE channel to the application "folders" about the topic "appproperties":
channel = ddeinit('folders', 'appproperties')
The "folders" application appears to be a synonym for "progman", the good ol' Windows 3 program manager. You can tell Explorer ("folders") to view a folder by executing
ddeexec(channel, '[ViewFolder("%l", c:\windows, 5)]')
If Explorer already points to that folder, no new window is opened. Unfortunately, I cannot tell you much more about that command. I don't know what that %l is doing there, or the 5 for that matter. The only thing I know is that ViewFolder can be replaced by ExploreFolder, in which case you always open a new window, and that window always shows the folder tree structure on the left pane.
More Information
The most important DDE-related functions are ddeinit, ddeexec, and ddeterm. Their documentation is buried inside the .m files of those functions. You can view the .m files by simply executing
edit ddeinit
Yair Altman has some more info on Matlab's DDE capabilities. What DDE commands are understdood by Explorer evades me. I assembled my example from what I found here.