Compiled Visual Basic Application gets Runtime Error 52 in Windows 8 - vb6

The application that I compiled via Visual Basic 6 can run on my Windows XP computer. But when I execute the same executable on my other computer that runs Windows 8, I always get Runtime Error 52-Bad File name or number as soon as I launch it. I can't run the program even if there is no "Shell command" in that program which leads to a "Bad file name" error.
I used "Package and Deployment wizard" for the packaging process.
And also I registered the needed DLL's on the Windows 8 PC manually via the regsvr32 command line utility.
I also cleaned the whole registry via a registry cleaner (Wise Registry Cleaner). I used compatibility mode for Windows XP but nothing solved the problem.
Additional informations:
XP Version - SP 2
Windows 8 Version-8.1
VB - VB 6.0

Assuming that your code is
If Dir("C:/file.txt") = "" Then...
Change it to a backslash ("\")

After some research I found the answer for the problem. That was not a problem in the coding; it was ALL about windows 8 compatibility.
Go to the “Compatibility” tab of the properties window of the file and select “Windows XP SP2” under the “Compatibility mode”. That’s all

Windows 8 no longer allows you to write programmatically in the root of drive C:\ (and in many others 'system' folders like Program Files, Windows, System32, ...).
Try to use a sub-folder.

Related

which file can install a program on windows 7?

Which of these files( in setup folder), if execute can install a program on windows 7 ?
1- setup.com
2-setup.ini
3-setup.inf
COM files are executable in Windows. You should be able to run setup.com from the CMD prompt by cding to the directory setup.com is in, and running setup or setup.com.
Keep in mind, COM files cannot be executed on 64-bit versions of Windows, since these editions lack NTVDM, the MS-DOS-emulating subsystem that handles COM file execution. You would instead need to emulate the 32-bit environment using an emulator like DOSBox.
setup.inf can be used to file copy and installation. I cannot remember setup.com installers for Windows programs.
msdn inf description

VB6 Legacy Code can't "Call Shell"

I am working on some legacy VB6 code and I am having my program break with this message:
and it then highlights this code:
I know that the specified locations exist per these screenshots:
I am running this Visual Studio 6.0 on a 64-bit Windows 7 machine. How can I make the program see shell?
command.com does not exist on 64 bit windows.
Try using C:\Windows\SysWOW64\cmd.exe instead. C:\Windows\SysWOW64 is a folder giving you backwards compatibility stuff for 32 bit.
But see the comment below (taken from Euro Micelli).
Really you should use %SYSTEMROOT\System32\cmd.exe instead. First, Windows is not always installed in C:\Windows; you should let the system figure that out. Second, using System32 is always correct for a 32-bit application: when running on Win32, it is the correct folder; when running on Win64, Windows will map %SYSTEMROOT%\System32 to %SYSTEMROOT%\SysWOW64
I use vb6 and windows 7.
I've done the same thing as you but I put the dos command in a bat file.
Login.bat
NET USE W: \\10.48.10.8\e$
Then in the code
Shell ("c:\login.bat")
The vb command is not correct for the OS that you are running. You need to check that that drive is not already mapped, and remove the command.com /c from the command that you are trying to execute.

Unable to write INI file in Windows 7 64-bit

I have a small program that keeps updating data every second like a mentoring software installed on my Windows 7 64-bit PC. The thing is that I tried it on other PCs and different OS like Mac and Windows XP and Vista, and things are just fine. The problem shows up when I use it on my new machine "Windows 7 64-bit" giving an error:
** unable to write file.ini **
I have BitDefender on the same PC, but not sure if BitDefender is the one that is blocking the file not to be written or it is Windows itself causing that...
Any idea how to resolve this issue??
Try to start your Application with administration-rights. Creating a file on C:\ isn't possible, if you don't have ne needed rights. Try to change the UAC-settings or write your file in another directory (Also not "Program files", "Windows" ... systemfolders)

Register RichTx32.Ocx in Windows 7 64 bit

I am trying to register RichTx32.Ocx for an application I am working on in Access 2010 (File Format 2003 mdb). I have been updated to Windows 7 64 bit (from Windows XP SP3 32 bit) and can't get the ActiveX OCX to register.
I have put the file in the system32 folder and get the following message: "The module "RICHTX32.OCX" may not compatible with the version of Windows that you're running. Check if the module is compatible with an x86 (32-bit) or x64 (64-bit) version of regsvr32.exe"
When I put the file in the SysWOW64 folder and run regsvr32 to that location, I get the following error message: "The moduile "C:\Windows\SysWOW64\RICHTX32.OCX" was loaded but the call to DllRegisterServer failed with error code 0x8002801c."
There are three obvious possibilities for this problem:
You are running the 64 bit version of regsvr32.
You have UAC enabled and when the OCX self-registers, its attempts to write to HKLM fail.
The OCX does not run under Windows 7.
I think the latter is unlikely and anyway I can't do much to help!
To get around issues 1&2 I do the following:
Open a Command Prompt as administrator (right click on a shortcut to the Command Prompt and select "Run as Administrator").
Run this command: C:\Windows\SysWOW64\regsvr32 C:\Windows\SysWOW64\RICHTX32.OCX
Did the following and seems to have worked. Aperently, I had to run CMD in Administrator Mode, even though I am a local administrator.
(1) First, you must perform this on EVERY computer that has 2010
(2) Copy RichTx32.ocx to the following directory: C:\Windows\SysWoW64
(3) Click the Windows 7 Start Button and in the Search area, type "command"
(4) The search will bring up a number of items, including "Command Prompt" at the top
(5) Right click the "Command Prompt" banner, and select "Run as Administrator"
(6) At the command prompt, enter: %systemroot%\SysWoW64\regsvr32.exe RichTx32.ocx
(7) This should successfully register your OCX.
Thanks to:
Rich Locus Logicwurks, LLC www.logicwurks.com
my english not good,so i hope you understand.
Ran that command C:\Windows\SysWOW64\regsvr32 C:\Windows\SysWOW64\RICHTX32.OCX and got the error: "The module "C:\Windows\SysWOW64\RICKTX32.OCX" was loaded but the call to DllRegisterServer failed with error code 0x8002801c." – Rick Jun 13 '11 at 20:18
ok in windows7 you need do this "user account control settings -----than "Never notice
"
---than reset ,
•Run this command: C:\Windows\SysWOW64\regsvr32 C:\Windows\SysWOW64\RICHTX32.OCX
it's gone be ok!

CVSNT install hangs forever in Windows XP 64-bit

I need to access some source code stored on SourceForge using CVS.
I used (many computers ago) to use WinCVS, so I downloaded it from SourceForge and installed it on this machine, which runs Windows XP 64-bit (latest SP).
However, during the second part of the install, when it tries to install CVSNT, the install asks all the usual questions, and hangs during the actual install.
I have traced the install using ProcMon, and the installer starts up, creates a temporary file in my temp directory (which is on drive E:), and then executes it.
I can't see any particular reason why the install hangs - there is no obvious loop. Both the original installer, and the temporary file create 2 threads, and one thread exits. So I guess the other thread is waiting for something which never happens.
Any idea how to proceed from here?
The issue is that the installer doesn't like the default installation path of c:\Program files (x86)\cvsnt — if you use c:\cvsnt the installer will proceed.
Update: this appears correct. If you still would like it in the default location under C:\Program Files (x86)..., use the 8.3 name (you can find it with dir /x), usually C:\PROGRA~2. As you can see in the screenshot, the last step appears correctly now. With a path with a space in it, it would hang forever.
Second part of wincvs --> cvsnt.exe get hangs with windows 7 due to incompatible, So you may try tortoiseCVS. It has the portable version and also working fine
SOLUTION FOR Windows 8 64-bit:
On Windows 8 64-bit I was unable to install CVSNT (even to c:\cvsnt), but I solved the problem by simple copy the whole CVTNT directory from my old pc.
I copied to C:\Program Files (x86)\cvsnt (exact location where wincvs expected to find cvsnt).
We had a similar problem on a machine at work (the difference being it was Windows 7 64-bit in our case). Even though the user had admin privileges, we were only able to resolve the issue by logging on directly as the admin before installing cvsnt.
Do not install the version of CVSNT that comes with WinCVS. It's an old, outdated, buggy version. Install a later release (at least 2.5.0.4).

Resources