I'm trying to drop a file in the users private folder so it can trigger an alarm (daily at a particular time) and open a webpage to notify the users on their daily tasks.

I'm facing challenges in dropping the file to private folder, this is how I want it to work.... Whenever the user executes the file it should copy itself to the users private folder.... How will I achieve this? I tried to get the path the executable and try to copy it to the private folder, but it doesn't seem to work (as the file is locked by another process)....

Is there another way to achieve this? Or can I have the exe file (say EXE1) completely dumped into another exe (say EXE2) so that when EXE2 is executed it drops the file EXE1? any pointers...

Thanks,

C K.
Posted on 2009-08-20 03:06:27 by karthikeyanck
Why on earth would you need to "drop an executable" in order to achieve this goal? Either you're going around this problem in a pretty wrong way, or you're trying to cover up that you really want to do something naughty.
Posted on 2009-08-20 04:54:43 by f0dder
lol, nothing naughty f0dder.... There was actually one such code that was written in VB by one of my friend that does this stuff, it actually drops a piece of code to the system32 folder and marks an entry in registry so it can start itself during the windows startup... and when the clock strikes 2 it opens up a window that reminds the user of the days work....

Why would you not trust me, this is the second time... earlier with injecting code which I learnt myself.... don't let me quit MASM pls... I have been striving to learn things since long

Thanks sincerely,

C K
Posted on 2009-08-20 06:28:07 by karthikeyanck
If you want to "trigger an alarm", do it the proper way: using the windows task scheduler, running as a service, or simply have your program wait for the right time. There's no reason to go around dropping executables, and especially not in the system32 folder (you, fortunately, don't have write access there on a sensibly configured system, anyway).

Asking about dropping executables will only make people suspicious of your intents.
Posted on 2009-08-20 06:42:20 by f0dder

I'm trying to drop a file in the users private folder so it can trigger an alarm (daily at a particular time) and open a webpage to notify the users on their daily tasks.

I'm facing challenges in dropping the file to private folder, this is how I want it to work.... Whenever the user executes the file it should copy itself to the users private folder.... How will I achieve this? I tried to get the path the executable and try to copy it to the private folder, but it doesn't seem to work (as the file is locked by another process)....

Is there another way to achieve this? Or can I have the exe file (say EXE1) completely dumped into another exe (say EXE2) so that when EXE2 is executed it drops the file EXE1? any pointers...

Thanks,

C K.


Asking questions like that insults people's intelligence and is not a good way to make friends.

If you continue with those kind of questions, you may find out what the meaning of "tar and feathered and run out of town" means?



Posted on 2009-08-20 06:54:44 by skywalker


I'm trying to drop a file in the users private folder so it can trigger an alarm (daily at a particular time) and open a webpage to notify the users on their daily tasks.

I'm facing challenges in dropping the file to private folder, this is how I want it to work.... Whenever the user executes the file it should copy itself to the users private folder.... How will I achieve this? I tried to get the path the executable and try to copy it to the private folder, but it doesn't seem to work (as the file is locked by another process)....

Is there another way to achieve this? Or can I have the exe file (say EXE1) completely dumped into another exe (say EXE2) so that when EXE2 is executed it drops the file EXE1? any pointers...

Thanks,

C K.


Asking questions like that insults people's intelligence and is not a good way to make friends.

If you continue with those kind of questions, you may find out what the meaning of "tar and feathered and run out of town" means?






Skywalker,

I wasn't insulting anyone... I was just trying to convey what I wanted to achieve... The way I would have conveyed may be a bit goofy... but that's what I was after (droping a file).. not insulting people  :sad:
Posted on 2009-08-20 07:05:41 by karthikeyanck

If you want to "trigger an alarm", do it the proper way: using the windows task scheduler, running as a service, or simply have your program wait for the right time. There's no reason to go around dropping executables, and especially not in the system32 folder (you, fortunately, don't have write access there on a sensibly configured system, anyway).

Asking about dropping executables will only make people suspicious of your intents.


The reason behind dropping them in the system32 folder is because the source arrives to the user from emails... they either execute them directly or save them to alternative directory and execute it at a later stage. So scheduling a task with exe's lying in different areas would not be a best practice.. Hence to make it common on all the machines I wish to drop them in a common place, system32 is one of them....
Posted on 2009-08-20 07:09:05 by karthikeyanck
Executables attached to emails dropping themselves to system32... that, combined with your previous post about injecting code into IE really screams "up to no good".

Use an installer and let the users pick an install location.
Posted on 2009-08-20 07:28:13 by f0dder
f0dder,

The executable arrive in emails because the users of this app is quite a few of them.. They don't drop themselves from the email, but I meant executed (just running the executable from the email client).. Alright, I wouldn't keep bugging for this piece anymore... let me try an find an alternative to this..

Thanks for your help guys...
Posted on 2009-08-20 07:46:45 by karthikeyanck
Well, use one of the standard installers, I'm sure they offer a silent mode - that'll also mean less risk of your application getting picked up as a virus. And, again, install to a standard location - don't even think about %SystemRoot% or %SystemRoot%\system32.
Posted on 2009-08-20 10:15:40 by f0dder
If you truly want to do what you said you want then the legitimate way to do it is (1) use an installer to install your software in the Program Files folder (or any other user-specified location) and then (2) use the Task Scheduler.

That's basically all you need.

Documents and Setting, as the name suggests, is not where you are supposed to keep any EXEs.
Posted on 2009-08-20 10:17:43 by ti_mo_n
I won't mention the security issues associated with the task scheduler if you don't?
Posted on 2009-08-21 05:08:02 by Homer
I won't mention the security issues associated with the task scheduler if you don't?
The task scheduler doesn't have to run tasks under the SYSTEM account, if that's what you're implying :)
Posted on 2009-08-21 05:17:46 by f0dder
:)
Posted on 2009-08-21 07:54:52 by Homer
Task Scheduler? What's that? Ah, yes i remember, a useless service that gets disabled together with useless "indexing service" and useless "system restore" (and a lot of other) even before installation takes place.

:P
Posted on 2009-08-21 10:22:31 by drizz