I have taken over work on a vs desktop application...
The setup program has an un-installer which is simply the uninstall.bat file
msiexe /x {PRODCODE}
when this runs one of the message windows is a 'are you sure you want to uninstall' and a DOS window opens with the command in the batch file showing.
Ideally I'd like to be rid of both of these - the dos window would be great, can live with the message box...
any tips on achieving this would be most welcome.
thanks you lovely people...
msiexec /qb! /x {PRODCODE} should disable the confirmation message, also displaying the operation progress window. You could try the other options: /q, /qn, etc.
Related
I have been using the .bat file with the typical cmd /min /C "set __COMPAT_LAYER=RUNASINVOKER && start "" %1" line of code to bypass the admin password window which has been working well in all cases.
However, in this case I run into a peculiar problem where 1. I open the install wizard using the aforementioned .bat, and 2. the wizard asks me for additional installations, which causes the admin password window to pop up (see below):
Obviously when I click that Install button I get the admin window to pop up again, however contrary to other cases I am unable to bypass that using the .bat file; there is simply nothing to drag and drop into the .bat file.
What I have tried doing is installing the two requirements one by one manualy using the .bat file which I have managed to do, however the wizard still comes up with the same window seemingly not recognising what I have already installed. Any help would be appreciated.
Try downloading 7zip and then drag the installer in the 7Zip logo. Then extract the file where you would usually want to it be installed at. Sometimes it works. I think it works with winRAR but I am not sure.
I'm experienced with many different programming languages. I decided to expand my horizons and try some simple batch scripts. I have a windows start up script that I'm running.
startupScript.bat
start "" "explorer.exe"
start "" "explorer.exe"
start "" "taskmgr.exe"
start "" "cmd.exe"
start "" "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
Works great. I would like to be able to move the windows where I want them though. I'm running 5 monitors, and I want the two explorer windows on my bottom left monitor each taking half the screen. I want the command prompt and task manager in my top left monitor each taking half of the screen, and I want my chrome browser on my bottom right monitor taking up the whole screen.
Chrome remembers where it was, so that isn't a problem. The other windows don't though.
Is there a way for me to run keystrokes after each program is started? I could do "winkey+left", "winkey+left", etc... for each window if that's possible. Otherwise how might I accomplish this?
Also, when the command line is run, the properties go to defaults. Is there a way to use my command line settings so that it is sized right, has quick edit mode enabled, and has the colors that I set it to?
I'd try setting up a shortcut to the application with shortcut/Run=normal window; layout and hues to taste. Then start the shortcut (.lnk file) in your batch. Certainly works for cmd - can't say for the others...
I would have a look at AutoHotKey. I don't remember enough to tell you what your script should look like, but the little I remember tells me all you need is in their toolbox.
I have a batchfiles which basicly just "echo"s text into the cmd window. I compiled it to an exe but want it to be in full screen without borders and without taskbar.(Windows 7)
It should work without having to create a shortcut or any other settings like this.
It can be in the Batch code or the exe but it should start in fullscreen when - for example - I download and execute it on another computer without me having to set any settings.
Is that even possible in Batch?
If you mean running cmd.exe in fullscreen in Windows 7, it's basically impossible. Lots of people were complaining about it.
There are plenty "fake" fullscreen command lines.
You can use this one and run the batch there.
Note: This is a question-with-answer in order to document a technique that others might find useful, and in order to perhaps become aware of others’ even better solutions. Do feel free to add critique or questions as comments. Also do feel free to add additional answers. :)
How can I display a messagebox by typing a single Windows command, e.g. in the Run dialog from the Start menu, or in the [cmd.exe] command interpreter?
One way is to use apparently undocumented functionality, namely that [mshta.exe], the runtime engine for Windows .hta HTML applications, accepts a general URL as command line argument, including a javascript: protocol URL:
mshta "javascript:var sh=new ActiveXObject( 'WScript.Shell' ); sh.Popup( 'Message!', 10, 'Title!', 64 );close()"
This command can be issued in e.g. [cmd.exe]], or e.g. in the Run dialog from the Start menu, perhaps combined with the schtasks command to create a tea-timer…
The above messagebox times out after 10 seconds, but specifying a 0 second timeout means “don’t time out”, producing a more ordinary persistent messagebox.
For a simpler messagebox you can instead use the alert function provided by the MSHTA host.
on command prompt:
msg %username% Message
interesting parameters are:
/w (wait for user)
/time:<seconds>
Found that if you copy msg.exe from a Win7 Pro machine to a Win7 Home machine it works. Copy msg.exe to and from the C:\Windows\System32 folder.
What if you create a small VBScript with the message you want to display?
I.e. create e file, named "Message.vbs" with the content:
MsgBox "Some info here", 0, "Message Title"
and call it like this:
cscript.exe PATH\Message.vbs
I have to update a Win32 application in order to handle the drag-and-drop of files over the icon of the executable.
I am not sure about how to proceed. A few researches led me to considering the "WM_DROPFILES" message, but MSDN syas it is "Sent when the user drops a file on the window", while I don't want to open a window.
Think of a command line tool "MyProgram.exe" : if I drag "MyFile.file" on the windows icon "MyProgram" in the desktop, I would like it to execute the same way as it would do when typing ">MyProgram MyFile.file" in the command prompt.
Any idea how to achieve this result ?
While it is true that apps get this for free by parsing the command line, there is a shell interface called IDropTarget you can implement if you need more control. See MSDN and this blog entry for more details.
Windows does this for you automatically. Any program foo.exe accepts drags of any file.
Martyn