Difficult with AutoPlay and AutoRun in Windows - windows-7

I feel pretty dumb at the moment, but for several days now, I have been completely confounded by the AutoPlay and AutoRun features of Windows. In essence, I have developed some software that will be deployed via optical media (e.g., CD-ROM, DVD-ROM). In a perfect world, our client wants the user to be able to simply pop in the CD and be off to the races.
We have explained to them that the actual AutoRun and AutoPlay features of Windows will be completely subject to the individual user's settings on his or her computer. But even with that said, on my own machine, I have been unable to detect and use an "autorun.inf" file.
The software itself is installed using a .msi file that is launched from a VBScript. Because the .vbs file is not directly an executable, I wrote a simple bootstrapper executable called setup.exe. Here is my very simple "autorun.inf" file:
[autorun]
open=setup.exe
That's it. No big deal. If I manually double-click the setup.exe, everything proceeds as expected. However, if I copy all of the necessary setup files to a disc (real or virtual drive) and insert the media, I do not have the option in AutoPlay to "Install or run program..."
I have tried tweaking my system AutoPlay settings to always install, and also to "Ask me every time." I am not sure whether Windows is not recognizing my disc as a "Software and Games" disc, or if it is just ignoring my autorun.inf file.
In any event, no matter that I try, whenever I test this out, I ONLY get the "General options" section of AutoPlay with the choice of "Open folder to view files."

Try this:
[autorun]
open=command /c start setup.exe

Related

Create windows process to delete any unwanted icons from the desktop?

IT has a process hidden somewhere deep on my system which automatically creates certain icons and shortcuts on my desktop if they do not exist. (It may even exist solely on their systems, connecting to mine periodically to do this.) This means when I try to delete them, they are back within a couple of hours. This drives me nuts. I have all of the shortcuts and icons on my taskbar, and do not like having random crap on my desktop.
I would like to write something to run as a service which monitors the desktop every second or so, and deletes anything that shows up.
How would I go about doing this? In a relatively easy and straightforward manner? Would I use a bat file, or vbs script? How do I create a bat file to run as a service?
If you have the "Hide protected operating system files" setting on (it is by default) you could try to just hide the icons with ATTRIB +R +S +H "annoyingapp.lnk".
You can't just run anything as a service. You could perhaps use the Srvany tool to execute your script but I would imagine a task that runs every now and then is a better fit for this issue.

"Browse", "Open file", "Select files" dialog not working

All of the sudden the method by apps open the "select a file" dialog stopped working. For instance if I go to https://uploadfiles.io/, clicking on it does nothing, but the drag and drop works.
This is happening for apps as well, for example I just needed to resync my Google Drive and change the folder location, clicking in "browse" to select a folder does nothing. However, going to Notepad and file > open file works.
I've been searching for a while for the method, .dll, or something that is responsible for this without success. Anyone with a similar issue or more knowledge than what I have can point me in the right direction?
I'm not a naive English speaker so I am not sure if I'm not finding anything because I am not using the right names to search for it.
Windows 10 64b INSIDER PREVIEW FAST RING
I have exactly the same issue. It started somewhere between Friday and today. (Computer was shutdown for two weeks until friday night and before shutting down the problem did not exist.) I suspect some update. In addition to the mentioned issue I have trouble downloading files through Chrome. Edge and IE are downloading fine. Firefox will be installed to test this. It is consistent which apps are (not) allowed to spawn new windows. Apps in 'Program Files' seem OK while those in 'Program Files(x86)' differ. Of those in the (x86) folder OpenOffice is allowed to open a browse window, Adobe Reader is not. KeePass is allowed to open files, EventGhost is not. (changing install folder does not make a difference).
Since it is not clear how long this issue has been around I am hesitant to do a system restore. Also I believe that is a bandaid, not a solution. I am on the Fast Ring of updates.

Opening a CHM file produces: "navigation to the webpage was canceled"

I am trying to open a .chm file.
I downloaded the source, extracted it, and double clicked on Waffle.chm and clicked "Open" but no matter what element in the chm file I click, I get the message:
Navigation to the webpage was canceled.
What you can try:
Retype the address.
What's going on here?
Summary
Microsoft Security Updates 896358 & 840315 block display of CHM file contents when opened from a network drive (or a UNC path). This is Windows' attempt to stop attack vectors for viruses/malware from infecting your computer and has blocked out the .chm file that draw data over the "InfoTech" protocol, which this chm file uses.
Microsoft's summary of the problem: http://support.microsoft.com/kb/896054
Solutions
If you are using Windows Server 2008, Windows 7, windows has created a quick fix. Right click the chm file, and you will get the "yourfile.chm Properties" dialog box, at the bottom, a button called "Unblock" appears. Click Unblock and press OK, and try to open the chm file again, it works correctly. This option is not available for earlier versions of Windows before WindowsXP (SP3).
Solve the problem by moving your chm file OFF the network drive. You may be unaware you are using a network drive, double check now: Right click your .chm file, click properties and look at the "location" field. If it starts with two backslashes like this: \\epicserver\blah\, then you are using a networked drive. So to fix it, Copy the chm file, and paste it into a local drive, like C:\ or E:. Then try to reopen the chm file, windows does not freak out.
Last resort, if you can't copy/move the file off the networked drive. If you must open it where it sits, and you are using a lesser version of windows like XP, Vista, ME or other, you will have to manually tell Windows not to freak out over this .chm file. HHReg (HTML Help Registration Utility) Utility Automates this Task. Basically you download the HHReg utility, load your .chm file, press OK, and it will create the necessary registry keys to tell Windows not to block it. For more info: http://www.winhelponline.com/blog/fix-cannot-view-chm-files-network-xp-2003-vista/
Windows 8 or 10? --> Upgrade to Windows XP.
"unblocking" the file fixes the problem. Screenshot:
Win 8 x64:
just move it to another folder or rename your folder (in my case: my folder was "c#").
avoid to use symbol on folder name. name it with letter.
done.
In addition to Eric Leschinski's answer, and because this is stackoverflow, a programmatical solution:
Windows uses hidden file forks to mark content as "downloaded". Truncating these unblocks the file. The name of the stream used for CHM's is "Zone.Identifier". One can access streams by appending :streamname when opening the file. (keep backups the first time, in case your RTL messes that up!)
In Delphi it would look like this:
var f : file;
begin
writeln('unblocking ',s);
assignfile(f,'some.chm:Zone.Identifier');
rewrite(f,1);
truncate(f);
closefile(f);
end;
I'm told that on non forked filesystems (like FAT32) there are hidden files, but I haven't gotten to the bottom of that yet.
P.s. Delphi's DeleteFile() should also recognize forks.
The definitive solution is to allow the InfoTech protocol to work in the intranet zone.
Add the following value to the registry and the problem should be solved:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTMLHelp\1.x\ItssRestrictions]
"MaxAllowedZone"=dword:00000001
More info here: http://support.microsoft.com/kb/896054
Go to Start
Type regsvr32 hhctrl.ocx
You should get a success message like:
" DllRegisterServer in hhctrl.ocx succeeded "
Now try to open your CHM file again.
other way is to use different third party software. This link shows more third party software to view chm files...
I tried with SumatraPDF and it work fine.
I fixed this programmatically in my software, using C++ Builder.
Before I assign the CHM help file, Application->HelpFile = HelpFileName, I check to see if it contains the "Zone.Identifier" stream, and when it does, I simply remove it.
String ZIStream(HelpFileName + ":Zone.Identifier") ;
if (FileExists(ZIStream))
{ DeleteFile(ZIStream) ; }
There are apparently different levels of authentication. Most articles I read tell you to set the MaxAllowedZone to '1' which means that local machine zone and intranet zone are allowed but '4' allows access for 'all' zones.
For more info, read this article:
https://support.microsoft.com/en-us/kb/892675
This is how my registry looks (I wasn't sure it would work with the wild cards but it seems to work for me):
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTMLHelp]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTMLHelp\1.x]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTMLHelp\1.x\ItssRestrictions]
"MaxAllowedZone"=dword:00000004
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTMLHelp\1.x\ItssRestrictions]
"UrlAllowList"="\\\\<network_path_root>;\\\\<network_path_root>\*;\\ies-inc.local;http://www.*;http://*;https://www.*;https://*;"
As an additional note, weirdly the "UrlAllowList" key was required to make this work on another PC but not my test one. It's probably not required at all but when I added it, it fixed the problem. The user may have not closed the original file or something like that. So just a consideration. I suggest try the least and test it, then add if needed. Once you confirm, you can deploy if needed. Good Luck!
Edit: P.S. Another method that worked was mapping the path to the network locally by using mklink /d (symbolic linking in Windows 7 or newer) but mapping a network drive letter (Z: for testing) did not work. Just food for thought and I did not have to 'Unblock' any files. Also the accepted 'Solution' did not resolve the issue for me.
Moving to local folder is the quickest solution, nothing else worked for me esp because I was not admin on my system (can't edit registery etc), which is a typical case in a work environment.
Create a folder in C:\help drive, lets call it help and copy the files there and open.
Do not copy to mydocuments or anywhere else, those locations are usually on network drive in office setup and will not work.

How to autorun a piece of software from a CD/DVD on Windows 7?

I want my software to run automatically from a CD/DVD with no user interaction whenever the user puts the CD/DVD into the drive. As far as I know autorun should still work with Windows 7, they just forbid it for USB drives.
But how?
Let's say I want to start my software xy.exe, what do I have to put inside my autorun.inf? I tried this but it's not working:
[AutoRun]
open=xy.exe
Is there anything else to do? Any suggestions?
See MS' official Autorun documentation at
http://msdn.microsoft.com/en-us/library/cc144202(v=vs.85).aspx
Your autorun.inf example looks OK to me - if you are testing on Windows 7 then I would expect you to see the "AutoPlay" Window when you insert the CD, with xy.exe as an option, above "open folder to view files".
If you get no pop up at all then try right-clicking on the disc in My Computer and selecting AutoPlay in the context menu.
You may need to pass an argument to the program to be auto played:
[autorun]
open=myprogram.exe /argument

As a developer, what changes do you make to a vanilla Windows install?

When I get a vanilla Windows system, there's a bunch of stuff I change to make it more developer-friendly.
Some of it I remember every time, other stuff I only do as and when.
Examples:
Show extensions of all file types
Make hidden and system file visible
Turn off Windows Defender
I seem to remember a blog post from Jeff on this topic, but can't locate it!
What else do you do, and do you have any tools that automate this process?
Indeed I do the above, plus deactivating Zip support (regsvr32 /u zipfldr.dll), activating the underscore on Alt shortcuts (Advanced Appearance), replacing Courier New by Andale Mono (replace with your favorite font) in all program settings (after installing it, of course), installing my favorite utilities (UnxUtils, Sysinternals', SciTE, FileMenu Tools which has Command line here and lot of other goodies, etc.) and so on.
Oh, and indeed also deactivate dual keyboard support (French/English), deactivate task grouping, install VirtuaWin (4 desktops), CLCL (clipboard manager), AutoHotkey and my favorite macros, and lot of other freewares, more or less must have.
No automation, alas.
I install Cygwin to have *nix command line tools and Xemacs to have a useful editor.
I install:
The usual suspects: Visual Studio, Sql Management Studio, Firefox, Chrome, etc...
Paint.Net
Notepad++
Launchy
The first thing I do is open a command prompt and then open the properties for it:
Switch on Quick Edit. Why is this off by default?
Increase the window size. Why limit it to the size of a postage stamp?
Increase the vertical buffer to the maximum possible. Why limit it to a few hundred lines?
Change the foreground colour to white instead of grey. Why make it less readable than it could be?
In summary: WHY?
Using the Add\Remove Windows Components in Control Panel, I always remove...
Games
Document Templates
MSN Explorer
Outlook Express
For the look and feel I...
Revert to the classic start menu; however, if it's Vista, I leave it as is because I like the indexed search feature.
Revert to a classic desktop with large icons and make sure that My Computer is the first icon (versus My Documents)
I also perform the things you mentioned above
Before installing any software I...
Install any outstanding Windows updates
Run a Disk Clean Up
Run Disk Defrag
Setup scheduled tasks for Clean Up, Defrag, and other personal tools
For tools (outside of my IDEs and other necessary development tools), I install..
TweakUI
IE6, IE7, Safari, Chrome, Opera, and Firefox
Install the set of Firefox plug-ins I always use for development
'Open Command Prompt Here' shell extension
Install Consolas and set it as the default font for my editors (IDEs, Notepad++, etc)
I wipe it and install Linux. Everyone is always amazed by how productive I can be. It's because I don't spend half my time fighting with the machine.
Install Consolas font and turn on (and tune) ClearType.
Install ZoomIt to magnify display during presentations.
Install FireFox/Firebug
Install XYplorer Win Explorer alternative (can't live without it!)
Install DeskPins to be able to make any Window temporarily topmost.
Make sure OneNote got installed with Office.
Install Visio.
Install favorite editor (whatever it is at the time, currently SCiTE).
Install 7Zip.
Fix Windows colors to suit me and put picture of RatPack (Dean's my hero) as wallpaper.
Disable shortcuts to FilterKeys, StickyKeys, and ToggleKeys - nothing frustrates me more than having to deal with that cruddy feature because I push the shift key down several times while I'm thinking or hold it down for eight seconds (again, while thinking) before I start typing!
Change the default action for Folder to explore instead of open.
over the years i have arrived to the decision that i do as little customization as possible since workplaces change and computers change (both at home and at work).
i used to do all kinds of crazy tweaks with litestep, setting up partitions, etc. these days i pare it down to the basics, and it does not take me long to setup a machine and have a familiar environment.
in addition to the usual "win32dev" setup (classic scheme, optimized for performance, no special effects, show all files, details in explorer views, blue background, etc) i have the following stack:
cygwin (gcc, vim, curl, wget, perl/ruby/python, svn, git, ssh, netcat, etc; rxvt for terminal)
ffox + adblock + dev plugins
clipx for simple stack-like clipboard with previews
textpad + a few basics syntax highlighters
virtuawin - the only minimal window manager that does all i need and nothing more
autoHotKey for basic app shortcuts
procexp to replace task manager
all other sysinternals tools
tortoise svn
putty + agent + keys
7zip
keepass
wireshark
everything i install by hand goes into c:\programs (for easy no-space, lowercase paths).
Regarding:
Show extensions of all file types
Make hidden and system file visible
I don't like making hidden files visible all the time (it makes two desktop.ini visible on my windows Vista desktop for starters) so I use an explorer extension to make it easy to toggle this on and off. There's also a corresponding one for file extensions:
HiddenFilesToggle Context-Menu Shell Extension
FileExtensionToggle Context-Menu Shell Extension
Command line scripts
For storing scripts that I use from the command line I create a Command Line Scripts directory under Program Files and add it to the PATH environment variable. I use the following batch file for listing and editing those scripts:
#echo off
setlocal
set UTILPATH=C:\Program Files\System Tools\Command Line Utilities
if not "x%1"=="x" (
start "" "notepad" "%UTILPATH%\%1.bat"
) else (
dir /b "%UTILPATH%" | grep -v com.bat | grep -P "(exe|bat|cmd)" | sed "s/\.\(exe\|bat\|cmd\)//"
echo.
)
(note that the filtering of the directory listing depends on some unix commands I have installed via Cygwin)
I give it the name com.bat, (short for command) then I can:
list the scripts in that directory by typing com at the command prompt
edit any script in the list by typing com script-name at the command prompt*, similarly:
create new scripts in that directory by typeing com new-script-name at the command prompt*
and if I ever need to edit com.bat I just type com com
* As I'm running Vista I have to use an elevated command prompt as directories under Program Files are protected.
For a quick way to launch an elevated command prompt, simply press the Win key; type cmd; press Ctrl+Shift+Enter; and then hit Alt+C to confirm the elevation prompt. Six keystrokes to an elevated command prompt! ([via][4])
Startup Script
One of the scripts I store in my Command Line Scripts directory is a script that is run when I log in to windows (via the Task Scheduler, type Task in the Vista start menu). I use that script to set up several virtual drives using the subst command to directories I access frequently or want a quick way to access on the command prompt or for shortening path names in compiler warnings, logs or debug output.
My Startup script looks something like this:
#setlocal
#set _MYDOCS_=%USERPROFILE%\Documents
#REM Note: first delete the drives so I can run script again
#REM to fix drives that failed to get mapped
subst /d W:
subst /d T:
subst /d S:
subst /d R:
subst /d N:
subst /d L:
subst /d H:
subst W: "%_MYDOCS_%\Work\SVN Working Copy\Website\trunk\www"
subst T: "%_MYDOCS_%\Work\SVN Working Copy\project 1\trunk"
subst S: "%_MYDOCS_%\Work\SVN Working Copy"
subst R: "%_MYDOCS_%\Work\SVN Working Copy\project 2\branches\12.50"
subst N: "%_MYDOCS_%\Work\SVN Working Copy\project 2\trunk"
subst L: "%_MYDOCS_%\Work\"
subst H: "%_MYDOCS_%\My Projects\Haslers.info\Working Copy"
Note that subst can be a little temperamental and occasionally the drives don't get created and I have to run the startup script again manually.
I'm surprised nobody has mentioned ClipX. I find that I can't develop without this clipboard history tool.
Step 1: Fix windows
Turn off System Restore
Turn off Windows Defender
Uninstall any OEM-supplied antivirus or other crapware if it's an OEM box
Get SysInternals AutoRuns and lay the smackdown to all the 8000 useless startup items and services vista inflicts upon you, including the slow and useless vista search indexing service.
Step 2: Install stuff.
Now that my shiny new Core 2 Duo PC isn't bogged down with useless crap running like a 386, I can build it up again
Install Firefox
Install FlashPlayer firefox plugin (why oh why isn't this bundled with FF?)
Run windows update and let it do it's download/reboot cycle 50 times until it's happy
While this is happening I can use firefox to browse stackoverflow and read reddit :-)
Get UnixUtils and either unzip them to system32, or otherwise make sure they are in the path.
This is neccessary because I can't stand cygwin, yet my muscle memory keeps typing ls when I try to type dir, and windows still hasn't heard of grep yet
Install Droid Sans Mono and Monaco fonts for programming
Install E-TextEditor
If I'm installing visual studio, do that. If not install the .NET framework runtime instead
Install Firefox addons (firebug, fission, web developer, adblock)
I add Wordpad to the Send To context menu. Instructions for XP here. Works in Vista, as well.
Someone gave me a 'Delete all SVN folders' registry script - that is a must have for me, now (it's somewhere on this thread).
I leave UAC on - last thing I want is to write code that works with UAC off, but fails miserably with it on. Before I started to use Virtual PC to set up test environments for my code, I tried to leave my desktop as 'vanilla' as possible - I wanted to test under conditions reasonably similar to an everyday non-developer user.
All of the above is for my home development system. I try to do the same at work, within reason. Except for the SVN stuff, because we use TFS at my office.
I always install the following to make it easier to manage and interact with windows
Taskix - Reorder buttons in your Windows taskbar
KatMouse - scroll the window directly beneath the mouse cursor
WinSplit Revolution - organize your windows by tiling, resizing and positioning them
allSnap - windows automatically snap to window edges and (optionally) the edges of other windows
I like to:
Make the taskbar larger so that it can hold two rows of applications
Disable personalized menus in the start menu
Disable grouping of similar taskbar items
I also randomly open a lot of PuTTY sessions to various machines, so I like to create a "bin" directory in my home folder, add it to the PATH, and then create a shortcut to PuTTY in it named "p" (among other shortcuts). I can then easily Windows-R (run) and type p [putty-session-name] to open the session. This has saved me tons of time / mouse clicks.
I follow the extensive recipe for making a Windows system useful built and maintained by Simon Peyton Jones.
Turn off Autorun so that I'm not accidentally installing malware or crapware.
Here's a couple of links, out of many:
http://antivirus.about.com/od/securitytips/ht/autorun.htm
http://news.cnet.com/8301-13554_3-9894970-33.html?tag=mncol;txt
Couple of things no-one else mentioned
Install Console2 for tabbed cmd windows
Install Powershell
Completely replace Notepad with Notepad2
Install the full IIS.
Set the resolution high enough.
Set the background to Grey.
Show hidden and system files.
Toolbar 2 or 3 high (I run one monitor sideways).
Always show file extentions.
I install some set of *nix command utilities and process explorer at a bare minimum.
Also, on XP systems I disable any theming and use the windows classic coloration. Vista just doesn't look or work right without the Aero theme so I can't do that on Vista without going almost completely nuts.
Also forgot, I install Chrome. (Used to be Firefox but Chrome is nicer out of the box)
I use nLite to prepare the windows installation disk in order to have some typical settings already set right after the installation.
For example:
Explorer-Associate additional file types with Notepad
Explorer-Classic Control Panel
Explorer-Disable Beep on errors
Explorer-Disable Prefix: Shortcut to
Explorer-Show extensions of known file-types
Explorer-Show hidden files and folders
Explorer-Show the full path in the Title Bar
Performance-Disable Info Tips on Files and Folders
Performance-Disable Last accessed Timestamp on files
Taskbar-Disable Group similar Taskbar buttons
Taskbar-Disable Language-Bar
Taskbar-Lock the Taskbar-Yes
You can also remove useless parts of the system:
Accessibility Options
Briefcase
ClipBook Viewer
I install all of the shell extensions I normally use (TortoiseSVN and CommandHere for example).
Also, one of the first things I do after I reimage a machine is make sure it's hooked to all of my network shares properly. Few things derail my work as quickly as having to fight with the network to get a file at an inopportune time.
Install emacs + a selection of gnuwin32 packages.
Also proexp to replace task manager.
Edi Weitz has a nice writeup of his customizations: Making Windows usable for old Linux farts
Switch to classic menu
Increase the taskbar hight to have more shortcuts & lock the taskbar
Performance options -> Adjust for best performance
Copy all the backed up shortcuts files to Favorites folder
Install necessary software (JDK, DBMS stuff, Editplus, MS Office etc.)
Driver for soundcard
New network connection for Broadband ...
I generally leave Windows Defender online but I don't use an antivirus so....
I set my start menu to display small icons and to have no "most recently used programs" active. Instead I pin everything to my start menu:
My start menu http://www.robpaveza.net/pub/startmenu.png
I also make sure that all the extension menus are actual menus, not just links, and that my computer and user files icons are shown on the desktop.
I download and install Cygwin and Xming.
Wow, this is a really good thread... I'm going to have to go through all the suggestions and see what I'm mission out on :)
Off the bat, I install:
Google Chrome
Visual Studio 2008
aShampoo CD Burning suite (or whatever my current favorite burning suite is)
IZArc (or whatever my current favorite is)
RocketDock - I use it to replace Quick Launch.
Songbird
When I used XP (I'm on Vista now) I'd always install Tweak UI and tweak everything to my liking. Like listing My Computer before My Documents.
I remove the Help icon from the start menu.
I make it so Network Neighborhood was displayed in the start menu.
I have it show file extensions and show hidden files/folders.

Resources