Link to home
Create AccountLog in
Avatar of logic2
logic2

asked on

Get the source code of a VB simple program

Dear Experts

I have a small program made by visual basic
it just takes some data and sorts them out and give u percentage
now this program somehow writes on drive where we dont have admin rights
our IT person didnt know how to fix this, so is there anyway that we can get the source code of the program so we can make it write to D instead of C, as i mentioned the program is simple so not a big code involved.
Avatar of Dirk Haest
Dirk Haest
Flag of Belgium image

If I understand it correctly, you don't have the source somewhere ? Is it written in the company (and do you mean vb6 or vb.net) ?

If you don't have the sourcecode, then you'll need a decompiler
If you don't have the source you can change it.
The best you can do is work with it, or have someone create a program for you.

There are some things that you might be able to try.
Usually the program uses the app.path of where the exe is located.
If exe is on C Drive it may try to write to C: if on D Drive to D:

You can change the rights of the user to allow program to write.
There are two places: Share Permissions Tab and Security Tab.

You can also try the Subst command.
Subst G:\Somewhere C:
now when you type C: it looks like C: buy you are really in G:\Somewhere
The problem with using C is that the Operating system uses C and can cause problems.

And last but not least move to different computer so that writing to C: is allowd.

I hope this helps.

Thanks
Roger
Avatar of logic2
logic2

ASKER

Hello All

This program was made by a collegue to help us in our work
now this colleague is no more with the company and we still need the program
All new OS images in our company are having admin rights so we cant change permissions for anything
also the program doesnt work wherever u run it from, it gives a runtime error

so how can we decompile it ?
Read on another forum: decompiling a program will never generate VB code. At most you will get assembly code from which you won't be able to learn.

Some decompilers (but propably it won't generat what you want)
http://members.lycos.co.uk/openscr/
http://www.vb-decompiler.org/index.php?p=help/description
SOLUTION
Avatar of Shanmuga Sundaram D
Shanmuga Sundaram D
Flag of India image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
The programmer could have placed a time bomb in the code so that after a period of time it will stop working.
Shasunder is absolutely correct, when you decompile to asm, that is just the beginning.  
Sometimes there may be very complex algorithms that dictate the need.

The progams itself should only take a few weeks to write from scratch, and would solve the problem both now and in the future.

Thanks
Roger
Avatar of logic2

ASKER

Hello All
Thanks for the replies
i understand that writing the program from scratch would be easier but thats under condition that u r a programmer not a network guy like me who just uses the program as a helper.

Anyway no solution i guess it was a bad trial
now am having a problem how to distribute the points or what to do exactly
is it possible to ask for a code that does the job over here ??
See this help-topic. Perhaps it helps you to decide how to split the points
https://www.experts-exchange.com/help.jsp#hi332
logic2,
It is unfortunate that you don't have the source code.

With your situation the best bet would be to contract someone to create it for you.

The benefit is that you know exactly what you want, how it should look, and all the rules.
Normally when creating a program from scratch the client(s) usually have a general idea of what they want and it changes as they learn of new posibilities.  This makes it take longer and cost more.

I don't know what the rules are if you wanted to contract someone from Experts Exchange, if you chose to go the route of contracting someone.
Avatar of logic2

ASKER

Hello Roger
i was thinking of splitting the points when i noticed the subst command you advised first
i didnt notice this at all, i can try it somewhere next week, however do you think it would work in my case ?
if not i'd just split the points, if you think it may then i'd wait to check and if it worked i'd give you the points
Hi logic2,

The Subst should take care of your issue.
c:\folderondrive
subst b: c:\folderondrive

B: will not be available and will show whatever is in the folder and subfolders.

To remove the drive:
subst b: /d

---------------
I am glad that I was able to help.

As far as points, I follow the askers's lead.
You know what helps and if you found usefull information from more than one source it is your call.  The experts that participate are amazing, and I have a great deal of respect for their contributioins.

One thing that is greatly appreciated by everyone that participates is that if you find something useful take the time to grade the solution :)

Let me know if there is anything else I can do.

Thanks
Roger
I'm not sure if the Subst will solve the problem. The program is now writing to the c-drive (this is the main-drive !). If you change this letter, it's possible that windows or other programs start to fail ...
Yes, you don't want to change C:

But You can do a test.

One of the tricks that VB developers use when you have to deal with a path is to use App.Path
This is wherever the vb exe program file is located.  The developer would have either hard coded:
MyPath = C:\ProgFolder
or
MyPath = App.Path     (Which would be C:\ProgFolder)

Subst B: drive for the location of the program's folder, go to B: drive and run the program from B: and see if it works.

We may need to move it to a different computer, the program can run on that computer's C drive, and if you share everything properly you should be able to get it back online within the network.

Thanks
Roger
Avatar of logic2

ASKER

guys am getting all confused now
i have the program in the E drive, lets name it program.exe, when it runs it writes somewhere in drive c
so the program path would be E:\program.exe
tell me exactly what do i need to do :)
Some things you need to try:
If you place your program on the e-drive, does your program run and where does he write the data ?

(If the path is hardcoded in the program, then you have a problem if you want to write to somewhere else)
Avatar of logic2

ASKER

wherever the program is it attempts to write somewhere is C because C is the only drive that has stuff blocked by our nice Admins, i have no idea whats actually inside the program
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
ASKER CERTIFIED SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of logic2

ASKER

Since i git sick of the situation so i submiited the points
23637269 was the most helpful so the most number of points hope that nobody gets upset
i already spoke with one of my friends to re-create a similar program for me
thanks a lot guys for your kind support