.bat file help lz ! :)

Blitz3D Forums/Blitz3D Programming/.bat file help lz ! :)

CodeOrc(Posted 2004) [#1]
Hey Everybody

I need help with syntax in my install.bat file. Ok, I have it creating directories and copying the files over to the harddrive and all is well...except.

From within the .bat file (dos commands) I want to copy a file to a users desktop. I do not know how to do this, especially since the users name will change depending on the machine I run my proggy on.

example.
mkdir c:\program_game
copy *.* c:\program_game
copy "my crazy little shortcut to the users desktop"

This is only for testing purposes. I would never do this to the general public, as a direct copy is actually considered intrusive, it's just for my lazy needs so I do not have to browse to the CD and copy to the HD.

Any help would be great- Thanx!


Chi3f Stadi(Posted 2004) [#2]
There's a system variable called "username". May you can use it for that.

echo %username%

will print the logged in username.


N(Posted 2004) [#3]
On XP and such, you can get the desktop path by grabbing the user's profile directory (the environment variable "HOMEPATH" or "USERPOFILE"- I'd recommend the latter since it seems like one that would exist on older systems) and then appending '\Desktop' to it.

So, basically, it would be:
copy *.* %HOMEPATH%\Desktop\

I think.


John Blackledge(Posted 2004) [#4]
Or use a proper setup program.
Try Clickteam - the do a free version:
http://www.clickteam.com/InstallMaker/


N(Posted 2004) [#5]
Do NOT use Clickteam's installer. Use InnoSetup.

Bad John! Bad!


N(Posted 2004) [#6]
Clickteam's has an ad at the end- it's annoying. Innosetup is free, has no restrictions, and has no ads.


CodeOrc(Posted 2004) [#7]
Why not use Click Team's? Are they part of a global domination group or something? :)

Just Kidding.

I tried CT's and I like it. I will give Inno a try and see how it compares.
tx