windows-shell

“Bring to front” for Windows XP command shell

旧城冷巷雨未停 提交于 2019-11-29 02:29:29
Is there a command I can put into a Windows XP .bat file to bring the command shell to the front? From a batch file, no. If you want to activate a window you have to use SetActiveWindow() . If you don't want to get dirty with windows programming but still want to activate windows and simple stuff like that, I highly recommend checking out Autoit . You could always call this program from your batchfile to have it do the task. nircmd will do this, though it involves a little scripting. nircmd win activate "titleofwindow" You basically need to know the title of the cmd window you are executing

Windows 10 equivalent of LaunchAdvancedAssociationUI

£可爱£侵袭症+ 提交于 2019-11-28 21:10:38
问题 Since Windows 10, the IApplicationAssociationRegistrationUI::LaunchAdvancedAssociationUI method does not work anymore. On Windows Vista, 7 and 8, it opens the Control Panel on the Set Program Associations page for specified application. On Windows 10, it does nothing. It's even documented in Microsoft documentation: Starting in Windows 10, this does not launch the association dialog box. It displays a dialog to the user informing them that they can change the default programs used to open

can .vbs file be a scheduled script?

与世无争的帅哥 提交于 2019-11-28 14:25:45
I have written a .vbs script which presently is run manually by users. How can I make this script schedule itself in Task Scheduler (to run at a fixed time each day automatically) on Windows XP and Windows 7 the first time it is executed manually? EDIT Option Explicit Dim oShell : Set oShell = WScript.CreateObject ("WScript.Shell") Dim FSO : set FSO = CreateObject("Scripting.FileSystemObject") Dim StartTime,Elapsed 'msgBox(oShell.CurrentDirectory) 'MsgBox(FSO.GetFile(Wscript.ScriptFullName).ParentFolder ) oShell.CurrentDirectory = FSO.GetFile(Wscript.ScriptFullName).ParentFolder StartTime =

reference a windows shell interface using .net 4.0

心不动则不痛 提交于 2019-11-28 13:31:47
I am using the following code to reference a shell dll Type t = Type.GetTypeFromProgID("Shell.Application"); Shell s = (Shell)Activator.CreateInstance(t); Console.WriteLine("success"); Console.ReadLine(); It works fine on my windows 7 development machine.But when I try running the exe on Win 2003 server I get this exception Unable to cast COM object of type 'System.__ComObject' to interface type 'Shell3 2.Shell'. This operation failed because the QueryInterface call on the COM compo nent for the interface with IID '{866738B9-6CF2-4DE8-8767-F794EBE74F4E}' failed due to the following error: No

How to control the size of the Windows shell window from within a python script?

烈酒焚心 提交于 2019-11-28 12:45:36
When launching a script-type python file from Windows you get a windows shell type window where the script runs. How can the script determine and also set/control the Window Size, Screen Buffer Size and Window Position of said window?. I suspect this can be done with the pywin32 module but I can't find how. You can do this using the SetConsoleWindowInfo function from the win32 API. The following should work: from ctypes import windll, byref from ctypes.wintypes import SMALL_RECT STDOUT = -11 hdl = windll.kernel32.GetStdHandle(STDOUT) rect = wintypes.SMALL_RECT(0, 50, 50, 80) # (left, top,

How to code a new Windows Shell? [closed]

自古美人都是妖i 提交于 2019-11-28 07:52:42
How would I go about coding a new Windows Vista Shell? Everything you need to do as shell has never been documented, so there are some issues with file change notifications etc. The basics are: SystemParametersInfo(SPI_SETMINIMIZEDMETRICS,...MINIMIZEDMETRICS) with (undocumented?) flag 8 Register as the shell (SetShellWindow,SetProgmanWindow,ShellDDEInit,RegisterShellHook etc) Hide welcome screen by setting a signal ("msgina: ShellReadyEvent" and "ShellDesktopSwitchEvent") Start registry run key, start menu\startup and ShellServiceObjects Set registry Explorer\SessionInfo The good thing is, you

Drag & drop of a dynamically created shortcut

做~自己de王妃 提交于 2019-11-28 04:41:58
问题 I have a C# application that creates shortcuts to launch other programs with specific arguments and initial directories. I would like the user to be able to drag a shortcut from the Windows form and drop it anywhere relevant like the desktop, the start menu, and so on but I don't really know how to handle that, could anyone point me in the right direction? I have seen a few samples using PInvoke and IShellLink like this one, or read answers on SO like here, which already help create shortcuts

Changing environment variables of the calling process

有些话、适合烂在心里 提交于 2019-11-28 04:18:44
问题 This one seems trivial but the answer has eluded me for a few days now. I have a Windows batch file, that calls a C# program to do an extra verification that cannot be done in a batch file. After the verification is complete I need to return a status and a string back to the calling shell. Now the return value is trivial and my C# console app simply sets a return value (exit code if you will). And I thought the string will also be a piece of cake. I attempted to define a new shell variable

how to get file properties?

大憨熊 提交于 2019-11-28 00:05:11
I want an application which displays the some file properties of a mediafile if available, like (don't know the exact english words used in windows for it) FileName, Length/Duration, FileType(.avi .mp3 etc.) I tried taglib and windowsapishell but I dont get a working result (references are good) ShellFile so = ShellFile.FromFilePath(file); so.Properties.System.(everythingIwant) shows me a lot of file properties which I want to have displayed, but I cant get it working An example of an error: 'WindowsFormsApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly

How can I create my custom Shell Context Handlers for Windows?

白昼怎懂夜的黑 提交于 2019-11-27 22:44:33
问题 Problem Language: C# 2.0 or later I would like to register context handlers to create menues when the user right clicks certain files (in my case *.eic). What is the procedure to register, unregister (clean up) and handle events (clicks) from these menues? I have a clue it's something to do with the windows registry, but considering how much stuff there is in .net, I wouldn't be surprised if there are handy methods to do this clean and easy. Code snippets, website references, comments are all