Unable to write INI file in Windows 7 64-bit - windows-7

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)

Related

Compiled Visual Basic Application gets Runtime Error 52 in Windows 8

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.

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.

WinDivert: What is the reason behind the error message "error: failed to open Divert device (110)"?

I tried to install WinDivert in my machine (Windows 7 64-bit OS). I tried with both 32-bit and 64-bit version. However, I failed at both of the cases and received the error message: "error: failed to open Divert device (110)". I followed Section 2 (Steps 2.1 and 2.2) of the tutorial: http://reqrypt.org/windivert-doc.html. I used "Free Build Environment" (x86/x64). I invoked wddk-build.bat. Then I signed the driver as it has been shown in the document (just as it is written). I restarted the machine and tried to run "netdump" and "netfilter" from "install/WDDK/..." from the command prompt. However, nothing works for me. Even I tried with the MS Visual Studio 10 (masvc-build.bat). What is the issue, I am suffering with?
WinDivert 110 error usually indicates that the driver failed to load. This can be caused by a number of different things. The checklist for a WinDivert (110) errors would be:
Make sure that you are using the 64-bit driver only for 64-bit systems, and the 32-bit only for 32-bit systems
Make sure the driver is properly signed (or test-signed with Windows test-mode enabled)
Make sure the WinDivert driver files (WinDivert.sys, WinDivert.inf, WdfCoInstaller*.dll) are in your program's directory when DivertOpen() is called.
Make sure you are running the program with Administrator privileges.
Usually one of the above is causing the problem.
EDIT: Some stubborn 110 errors can be fixed by manually stopping/starting the WinDivert service, e.g. by running the following commands as Administrator:
sc stop WinDivert1.0
sc delete WinDivert1.0
EDIT (2): Note that WinDivert (110) errors have been replaced with more meaningful error codes in version 1.0.3 and above.

What is PnPUtil.exe location in 64bit systems?

I would like to install my USB device driver [.inf file] using PnPUtil.exe utility on both 32bit and 64bit systems for Windows Vista and Windows 7.
I tested on my machine [Windows 7 32bit] and everything was fine because PnpUtil.exe is located in: C:\Windows\System32\PnPUtil.exe.
But in 64bit Windows 7 the utility is not in this directory.
When I tried installing driver on different Windows 7 - 64bit machine I could found PnPUtil.exe in this location: C:\WIndows\winsxs\amd64_microsoft-windows-pnputil_31bf3856ad364e35_6.1.7600.16385_none_5958b438d6388d15\pnputil.exe
and the test was also fine.
So how can I exactly detect this directory on all platforms?
I noticed the path is dependent on built of Windows version - 6.1.7600.16385 - but how to detect the rest of path?
Or is the path always the same on all 64 bit platforms? And what about Vista?
The location of PnPUtil.exe seen from you installer application depends on the bitness of your installer:
32bit installer on 32bit Windows: %WinDir%\System32
64bit installer on 64bit Windows: %WinDir%\System32
32bit installer on 64bit Windows: %WinDir%\Sysnative (Windows Vista and up)
More info here:
http://www.samlogic.net/articles/sysnative-folder-64-bit-windows.htm
I recently came across this problem while trying to create an installer for ReplicatorG, which includes the Arduino drivers and some drivers specific to the Makerbot Replicator.
It seemed that there isn't any way to determine the location of PnPutil, and I instead had to acquire Microsoft's DIFx and use their redistributable DPinst.
There were a couple of strange things about DPinst that made it difficult to use. The first is that it didn't seem to run properly if it was located in a directory tree with spaces in the path. Who knows why. The second was that, because the Arduino drivers are unsigned, it needed to be run in legacy mode to keep from popping up a big, red dialog warning the user. To run it in legacy mode you use the /lm flag, but the flag must be lowercase. Again, it's unclear why.
In the end, I had the installer copy dpinst and each of the drivers to a folder in the temporary directory and then run dpinst. It pops up a nice little wizard and tells the user which drivers were installed.
From C:\WIndows\winsxs\
dir /s PnPUtil.*
will scan subdirectories

Resources