How do I make my VB.NET program run in MS DOS environment? - vb.net

So if I made a VB.NET normal windows.form application and then booted into ms dos mode, i am able to run notepad and taskmgr but any normal exe file will just give me an error saying it can't be run in MS DOS mode. Is there a way I can make it compatible with MS DOS environment?

If by "MS-DOS " you mean "command Line" then you can mark your Project as a "Console Application" when you create it in visual studio. This should enable it to run in the command line.
If by "MS-DOS" you mean the 20 year old operating system by Microsoft, it cant be done.

Related

regsvr32 msinet.ocx Error

(Trying to solve my ultimate goal- Connecting to FTP from Excel to automate file sharing (VBA Beginner))
I'm trying to add Microsoft Internet Transfer Control but it doesn't show up in Excel VBA when I go to Tools>Reference so I followed this site.
msinet.ocx was not in my system32 or SysWOW64 folder so I think I'm supposed to install it at command line so I initially tried running regsvr32 msinet.ocx at C:\Windows\System32 and C:\Windows\SysWOW64 and I get the same error for both: "The module msinet.ocx failed to load. Make sure the binary is stored at the specified path or debug it to check for problems with the binary or dependent .dll files. The specified module could not be found."
Then I tried running cmd.exe as an administrator and trying it again in both System32 and SysWOW64 and I still get the same error popup. I don't know what to try now. Do I need to do a System Restore? And is that a safe thing to do on my work laptop?
P.S. I'm on Windows 7 Enterprise 64 bit
You properbly need to run the CMD as administrator to get your regsrv32 to work.
I had the same problem in windows 2012 server and it only works when you run the CMD as administrator and then type the regsrv32 "C:\Windows\sysWoW64\msinet.ocx"
I got it finally through this link - https://social.technet.microsoft.com/Forums/windows/en-US/ee5696aa-c94d-481a-bbbe-4dad30ccae7f/vista-error-message-msinetocx-not-correctly-registeredfile-is-missing-or-invalid?forum=itprovistaact
Using Peter's and BVBravo's posts

How to make my program run at startup using installsheild

I was wondering how can I my program to run at windows start-up using the registry editor in installsheild limited edition in visual studio 2012. The program is a timer for individual users and for it work properly it needs to e able to run automatically at startup. it's written in vb.net, incase it's important.
I did see a similar question which point that i can do it using the following line:
My.Computer.Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True).SetValue(Application.ProductName, Application.ExecutablePath)
but i was wondering how to do it using the installsheild.

Running .EXE file made in visual studio 2005 failure

I would like to run a .exe file made with visual studio 2003 but I get an error every time I run it on a windows 7 machine, vista machine, and xp machine. The error on Windows 7 and vista says "application has stopped working" and then makes me close the error box.
In windows xp it's a little different error, "the application failed to operate (0xc0000135) Click on OK to terminate the application."
That error code seems to indicate the application failed to initialize correctly.
It is possible that the anticipated .NET version is not present.
As far as I know, VS 2003 by default compiles against the .NET 1.1 library. There is no straightforward way of installing this on a Windows 7 or Vista box. Do you need to compile it against the .NET 1.1 library, or can you load it in VS2005, change the output .net version to 2.0 or higher, and recompile the application?
If you have the source code to the application, try running the application in debug mode and stepping through line by line until you find the exception. If you do not have the source code, possibly try running the application in a couple different compatibility modes. Another option to try is to check the windows event log for anything more specific.
If you want to get really deep into it, you can use SysInternals ProcMon.exe and filter on the failing exe to view the WinAPI calls that are happening during the failure.
Also, a basic search of forums shows that error is usually accompanied with framework issues. Either recompile the application or check out what your required framework is in the VS2003 project settings.

VB.net and running an external .exe program in both Administrator mode and compatibility mode (windows xp sp2)

Hey all i am trying to find some code that would allow me to run a program with administrator rights and also windows xp sp2 compatibility mode. But i have not yet found any code to do that using VB.net
Any help/links would be great! Thanks!
David
If you don't have to pass command line params, you can create a shortcut to the exe, and set it to compatibility mode and admin there. Then just ShellExecute the shortcut.

Windows Server 2008 and com objects

I'm moving a Dll (built in c++) from windows 2000 server to a 2008 server but im have some trouble registering it. In 2000 all you normaly have to do is a "regsrv32 name.dll" but this will not work in 2008 because you get a pointer error, iv also tried to use "gacutil /i name.dll" because someone told me this might work, but it didnt. So, I'm kind of desperate, is there anyone that have some solution to how i can get this c++ dll to work in 2000 server so that i can access it from an old classic asp page.
EDIT:
This is the error when running regsrv:
"
The module "name.dll" was loaded but the entry-point DllRegisterServer was not found.
Make sure that "name.dll" is a valid DLL or OCX file and then try again.
"
Note that I cant edit the dll file in anyway.
If UAC is enabled, are you running an elevated command prompt when you call regsvr32? If not, you'll probably get an access denied error in the registration function (which could manifest itself in all sorts of bad ways for something that old).
You have to be logged in as an admin, then run Command Prompt with right-click, "Run as administrator".