Normally explorer.exe starts with Windows.
I want when Windows starts to run My Form Application (myform.exe) instead.
And when I click a button on myform.exe then I can run explorer.exe (desktop).
How can I do it?
Regedit: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell
Here I wrote myform.exe instead of explorer.exe. My program runs but when I click the button it launches My Computer folder, not desktop.
Are you using System.Diagnostics.Process.Start() on your button click event? If so, then add your desktop as an argument, like this:
System.Diagnostics.Process.Start("explorer.exe", #"%USERPROFILE%\desktop");
Related
I'm developing a Windows app and within there is a django server running continously. Is there any possibility to hide the window to system tray from cmd? I don't want to use any external programms. I have a .bat script that starts the server and minimalizes the window to taskbar with this command :
START "runserver" /min python manage.py runserver
But I want to hide it to system tray, not taskbar. Is that possible?
You can't hide a console application because it does not actually have a window to hide, seeing as how it is running in the console (the console itself is just a window of the console, not the app running in it)
I have a wpf app with the main form hidden, only a taskbar icon to interact with.
It works fine, i mean, exe double-click icon appears, interact, close...
On Windows 7 also works without any issue.
Here the weird thing... If i create a scheduled task to launch it on user login, it works only in W7, in Windows 10 the icon is hidden.
I know that the app is running and doing stuff because of the implemented log.
By the way, i'm using Harcodet taskbar declared in xaml this way:
<tb:TaskbarIcon x:Name="TBIcon"
IconSource="{Binding ViewModel.Status, Converter={StaticResource TaskBarIconConverter}}"
ToolTipText="{Binding ViewModel.TbIconToolTip, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
...
Windows version is 10.0.16299.64
Any help?
UPDATE:
You have to change the scheduled task option to "Run only when user is logged on" (makes sense...)
You have to change the scheduled task option to "Run only when user is logged on" (for W7 and W10) in the general tab of the task:
How can I run an internet browser with an url, any url I want, and it opens but it opens in background without showing a window?
It should be like a background media player. And if you know how to do that please tell me and tell me how I can mute the browser once starting. I am trying to do this with a batch file.
You can open a hidden window with powershell. You can use powershell commands within cmd or in a .bat file as well. Here's an example:
powershell saps 'https://stackoverflow.com/questions/44642194' -wi hidden
That opens a hidden window of your default browser with the specified link.
I'm new to Advanced Installer. After Installing the file setup, I need to run a ".bat" file before running my ".exe" file every time. I found to add it, setting it's attributes as (Hidden, Vital and System), but I need to run it every time before lunching the application.
Please help me, Thanks
If you're launching the application as a Finish Action from the Dialogs page, here are the steps:
go to Custom Actions page and add a Launch File custom action without sequence to launch the BAT file
enable the custom action's "When the system is being modified (deferred)" and "Run under the System account with full privileges (no impersonation)" options
go to Dialogs page, select the ExitDialog from First Time Install in the Install Sequence
select the Finish button then go to its Published Events tab and enable "Show all events" option
add an "Execute custom action" event passing in the "Launch file" created above as an argument
set the event's condition to the checkbox's name so the BAT doesn't execute unless the user selects the checkbox to launch your application
make sure the event is the first one in the Published Events list so it gets executed before the event that launches your application
There are a couple of articles to help you with other details:
How to launch a CMD or BAT file?
How to launch a file after an installation?
The main thing you need to consider is to run the event that executes the BAT custom action before the event that launches your application.
Also, I'm not sure you can do this from a Professional project type. You may need Enterprise or Architect.
I'm using VWD Express 2008 to develop a WPF Browser Application. When I start debugging, it launches the XBAP in my default browser, which is Opera. Obviously, XBAPs don't work in Opera, so I have to repeatedly right-click on the document to open in IE.
Is there any way to change the settings for PresentationHost.exe so that it always opens with IE? A registry setting, perhaps?
Setup the external program as Internet explorer path and the command line arguments as your path to xbap file within quotes, like shown below:
A simple and easy way to do this is to associate *.htm or *.html (don't remember exactly, try both) files with IE, and it will work for XBAP.
UPDATE:
Solution described above works for "Start external program option".
For "Start browser with URL" option you actually can set default browser in Visual Studio. I don't find how to set it through Tools -> Options, but you can achieve it by following steps:
In your solution explorer find a file which meant to be viewed in browser (e.g. *.htm, *.svc)
Right click on this item and choose "Browse With..."
In the opened window you'll see a list box with installed browser and one of them will be marked as default.
In the list box Choose "Internet Explorer" and click "Set as Default" (if there is no IE browser in the list just add it).
Set Default browser to IE for WPF:
Project preporties -> Debug tab properties...
Remove "-debug" only, if there in Command line arguments:(under Start Options)
Choose Start external program ( under Start Action) and give the path of "iexplore.exe"
(EX: C:\Program Files\Internet Explorer\iexplore.exe )
XBAP does work in Opera (and I can make a screenshot to prove the point). Consider updating your Opera version and/or .NET (do you have SP1?).
Check out this post on the msdn forums.
The workaround I found works OK, but requires that Firefox be your default browser:
In Firefox, open the menu Tools / Options / Downloads.
Then click on "View & edit actions" and change the action for XBAP applications to the Windows Presentation Host.
Now when I debug, Firefox receives the XBAP, but then it automatically pass it to the presentation host, which runs into IE. A bit cumbersome, because everytime a new tab gets opened in Firefox, but it's OK. It also works with F5, so you can debug.
Alternatively, you can start IE, navigate to the XBAP URL and then manually attach the debugger to the PresentationHost process (not to IE though).