Abyssmedia.com Forum Index Abyssmedia.com
Abyssmedia Support Forums
 
  FAQ    Search    Memberlist    Usergroups   Register 
  Profile    Log in to check your private messages    Log in 

%myfiles% not work please help

 
Post new topic   Reply to topic    Abyssmedia.com Forum Index -> Quick Batch File Compiler
View previous topic :: View next topic  
Author Message
ghosti



Joined: 03 Jul 2007
Posts: 3

PostPosted: Tue Jul 03, 2007 1:25 pm    Post subject: %myfiles% not work please help Reply with quote

hi,

here is my batch file

@echo on

copy %myfiles%\welcome.exe C:\Documents and Settings\All Users\Start Menu\Programs\Startup
echo done

no file was copy to there!!

please help

i am using 2.1.5.0
Back to top
ghosti



Joined: 03 Jul 2007
Posts: 3

PostPosted: Wed Jul 04, 2007 3:50 pm    Post subject: Reply with quote

any kind soul out there that can help?
Back to top
ghosti



Joined: 03 Jul 2007
Posts: 3

PostPosted: Fri Jul 06, 2007 1:02 pm    Post subject: Reply with quote

look like this software not worth to buy after all!!

support was so bad!!!
Back to top
Zyzy



Joined: 07 Jul 2007
Posts: 1

PostPosted: Sat Jul 07, 2007 10:40 pm    Post subject: Im working on it Reply with quote

yeah im trying to figure out whats up with thats %MYFILES% environment variable too...im still workin on it. If I find something ill let you know.
...seems theres not a lot of people around on the forum...

Zyzy
Back to top
J Dark Shadow



Joined: 07 Jul 2007
Posts: 16
Location: N/A

PostPosted: Sat Jul 07, 2007 11:15 pm    Post subject: Here's your solution ghosti Reply with quote

So this was your batch file:

copy %myfiles%\welcome.exe C:\Documents and Settings\All Users\Start Menu\Programs\Startup
echo done



The reason why there was no file copied is because your command line was incorrect. You can't put spaces in a path without using ".

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

is the same as:

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

This would work.



OR



You can also use the ~ symbol in your path instead of using ". You have to write down the first 6 letters (without spaces) of the path followed by ~1.

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

is the same as:

C:\Docume~1\AllUse~1\StartM~1\Programs\Startup

This would work also.



Here's a tip: If you want you can also use the default set environment variables of Windows. You can get a list of them by typing "set" in the command prompt.

So it means that this path:
C:\Documents and Settings\All Users\Start Menu\Programs\Startup

is also the same as:

"%ALLUSERSPROFILE%"\StartM~1\Programs\Startup

Note: Don't forget to use the " like in this case, because even tough this variable is already defined by Windows, the real path still contains spaces.



J Dark Shadow
Back to top
support
Site Admin


Joined: 13 Feb 2004
Posts: 378

PostPosted: Sun Jul 08, 2007 1:39 am    Post subject: Re: Here's your solution ghosti Reply with quote

J Dark Shadow wrote:
So this was your batch file:
C:\"Documents and Settings"\"All Users"\"Start Menu"\Programs\Startup

This would work.


Yes, you right. But why not:

"C:\Documents and Settings\All Users\Start Menu\Programs\Startup" ???
Back to top
J Dark Shadow



Joined: 07 Jul 2007
Posts: 16
Location: N/A

PostPosted: Sun Jul 08, 2007 2:35 am    Post subject: That's right Reply with quote

Yeah that's right I forgot to tell, thanks support. You can also use this:

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


It's just to say, don't forget that we use the " to precise a data string and to separate them from others, not only in paths but also in command lines.

Here's a quick example, like when you use the "reg add" command which is a registry tool in Windows XP.


This would work:

reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v cmd /t REG_SZ /d "%SYSTEMROOT%\system32\cmd.exe" /f



But this wouldn't, because the command doesn't make the difference between the command, the registry path, the value name, the data type, the data itself and the parameters. The command is incorrect and you get an error:

reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v cmd /t REG_SZ /d %SYSTEMROOT%\system32\cmd.exe /f


So it's very important that you learn where to put " in your DOS commands and batch files if you want them to work correctly.



J Dark Shadow
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Abyssmedia.com Forum Index -> Quick Batch File Compiler All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001-2011 phpBB Group