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
%myfiles% not work please help
Im working on it
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
...seems theres not a lot of people around on the forum...
Zyzy
-
- Posts: 16
- Joined: Sat Jul 07, 2007 10:58 pm
- Location: N/A
Here's your solution ghosti
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
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
Re: Here's your solution ghosti
Yes, you right. But why not:J Dark Shadow wrote:So this was your batch file:
C:"Documents and Settings""All Users""Start Menu"\Programs\Startup
This would work.
"C:\Documents and Settings\All Users\Start Menu\Programs\Startup" ???
-
- Posts: 16
- Joined: Sat Jul 07, 2007 10:58 pm
- Location: N/A
That's right
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
"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