Run .bat in any user

December 16, 2010 at 22:17:21
Specs: Windows XP, core 2 duo / 1gb
Hi,

could any one help me about this.

copy "..\\file\Image.jpg" "C:\Documents and Settings\USER\Start Menu\Programs\Startup"

what if i run it in another user, it will not run. i just want to know if there is an alternative for any users who logged in the computer.


See More: Run .bat in any user

Report •

#1
December 17, 2010 at 04:11:44
Well, that's probably because the security of the folder is restricted so that other users cannot access. Home folders in the "documents and settings" directory are normally restricted for the access of Administrators, the owner and SYSTEM.

However, why do you need to do this copy? Do you need for each user to have that file into their startup directory? If that's the case, it would be a better approach to copy the file under the "All users" folder, that way you don't even need to ask the user to run the instruction.

If you however persist in your idea, may be you could use the environment variable USERNAME and run something like
copy "..\\file\Image.jpg" "C:\Documents and Settings\%USERNAME%\Start Menu\Programs\Startup" instead, which would copy the file to the startup folder of the logged user.


Report •

#2
December 17, 2010 at 05:31:30
Why do you think there is a "All users" directory?

Put it in:

C:\Documents and Settings\All Users\Start Menu\Programs\Startup

Happy is ONE who says I am an OttoMAN.


Report •

#3
December 20, 2010 at 00:31:59
Hi,

davidgpv: i tried your copy "..\\file\Image.jpg" "C:\Documents and Settings\%USERNAME%\Start Menu\Programs\Startup" but it doesn't work. any further suggestion?

Mus: there is no All users directory in my P.C.

thanks for the both of you


Report •

Related Solutions

#4
December 20, 2010 at 06:42:20
What?

You use Windows XP, and dont have All users folder in Documents and Settings?

Weird.

Happy is ONE who says I am an OttoMAN.


Report •

#5
December 20, 2010 at 23:35:01
What i mean is, it doesn't work either, even if i use "all users".
C:\Documents and Settings\All Users\Start Menu\Programs\Startup

Report •

#6
December 21, 2010 at 01:22:12
When you say it doesn't work, what error message are you getting?

Report •

Ask Question