Ok, I have to often change machine (to go on another, not to buy a new one:)) I programming on. It's kinda crappy when you have to install all software and stuff, and carry your sources on floppy discs.
So I thought, what if I put masm32, radasm, OllyDbg, documentation and other crap that I might need on USB Flash stick. Then I create program that adds all path names to PATH using Get/SetEnviromentalVariabe(), and after I through deletes those added sections. What do you thik, will it work?
Still, I kinda puzzled with few questions:
1. What kind of previlegies I need in NT/W2k/XP to install USB Flash?
2. What kind of previlegies I need in NT/W2k/XP to change enviromental variables?
3. How can I obtain drive letter assigned for my flash?
So I thought, what if I put masm32, radasm, OllyDbg, documentation and other crap that I might need on USB Flash stick. Then I create program that adds all path names to PATH using Get/SetEnviromentalVariabe(), and after I through deletes those added sections. What do you thik, will it work?
Still, I kinda puzzled with few questions:
1. What kind of previlegies I need in NT/W2k/XP to install USB Flash?
2. What kind of previlegies I need in NT/W2k/XP to change enviromental variables?
3. How can I obtain drive letter assigned for my flash?
I can only give idea how to do step 3: set the name of the mobile drive to "Flash MX" , for instance, and then with some small asm proggie use GetLogicalDrives to obtain bitmask. According to that bitmask, check each drive with either GetVolumeInformation or GetDriveType.
you'll need to have a piece of code like this:
btw, if you're using GetDriveType, then there's no use renaming the drive :)
you'll need to have a piece of code like this:
.data
DrivesMask dd 0
ThisDrive db "X:\",0
.code
invoke GetLogicalDrives
mov DrivesMask,eax
mov ecx,3 ; skip A, B and C:\
.while ecx<32
push ecx
mov eax,DrivesMask
shr eax,cl
and eax,1
jz _drive_not_present
mov al,"A"
add al,cl
mov ThisDrive,al
invoke GetDriveType,addr ThisDrive
.if eax==DRIVE_REMOVABLE
; do the business, I don't know what - maybe write in autoexec.bat
; ...
pop ecx
jmp _we_found_it
.endif
_drive_not_present:
pop ecx
inc ecx
.endw
_we_found_it:
btw, if you're using GetDriveType, then there's no use renaming the drive :)
Your USB flash has a limit for how many times it can be written until it will fail. This limit is pretty high (5k or something) but of course unless you are going to develop on it :D
Then you wll make many writes of smal files and this might exhaust it... besides they are pretty slow compared to a HDD.
USB flash devices are primary used to carry data between locations, unfortunately they are not very suitable for working on them ...
USB flash will be automaticaly detected on Win2k/XP but not on Win98, i think you will be able to see it on Win2k even if you are not Admin :P
IMHO is better to buy an old laptop if you want to go mobile
Then you wll make many writes of smal files and this might exhaust it... besides they are pretty slow compared to a HDD.
USB flash devices are primary used to carry data between locations, unfortunately they are not very suitable for working on them ...
USB flash will be automaticaly detected on Win2k/XP but not on Win98, i think you will be able to see it on Win2k even if you are not Admin :P
IMHO is better to buy an old laptop if you want to go mobile
Good idea. I bought a usb watch w/ 256mb from thinkgeek.com, and I've been transferring source code between several computers. It's a bit of a pain in the behind to.... Before I leave work/home, I manually check file dates so that I only update files on my watch that have actually been updated. I was thinking of coding something that would compare files and then update only the different files. I coded a really simple file compare algo that could be used, although there are some more complicated and probably better ones in the algo board. USB1 is pretty slow, so something like this would be pretty useful. I've been told that usb2 is incredibly faster, but unfortunately the watch uses usb1.
will
will
Ultrano, :alright:, that's exactly I've been looking for. I think naming flash and then calling GetVolumeInformation would be more failproof solution, who knows what digital cameras are plugged in the machine :).
I have, however, hit the wall with environmentals. More here:http://www.asmcommunity.net/board/index.php?topic=14767
I'm aware of that you can write only certain times to flash, but the number of erase cycles is more like 1M rather than 5k (at least on the one I have ordered). That makes, what, 27 years if you are seving your files 100 times in day 365 days in year. Fine enough for me!
Well I have tested installing "removable drive" (digital camera) on w2k using Guest account. Works fine. Now I'm wondering will it work on NT4. There is written everywhere that it does not need drivers on Win2k/XP, but how about NT? Does NT even support USB? About w98, I'll never touch that stuff with 10m long stick (almost as bad as ME).
According actual results USB1.1 flashes about 0.6MB for writing and 0.85MB for reading. USB2: writes 1.5MB and reads 6MB. I think it would be enough for simple programming.
Does anybody knows by the way, how one can move or install Platform SDK help on USB Flash. It's pretty big (105MB), but I think it's one of must-to-have thingies.
I have, however, hit the wall with environmentals. More here:http://www.asmcommunity.net/board/index.php?topic=14767
I'm aware of that you can write only certain times to flash, but the number of erase cycles is more like 1M rather than 5k (at least on the one I have ordered). That makes, what, 27 years if you are seving your files 100 times in day 365 days in year. Fine enough for me!
Well I have tested installing "removable drive" (digital camera) on w2k using Guest account. Works fine. Now I'm wondering will it work on NT4. There is written everywhere that it does not need drivers on Win2k/XP, but how about NT? Does NT even support USB? About w98, I'll never touch that stuff with 10m long stick (almost as bad as ME).
According actual results USB1.1 flashes about 0.6MB for writing and 0.85MB for reading. USB2: writes 1.5MB and reads 6MB. I think it would be enough for simple programming.
Does anybody knows by the way, how one can move or install Platform SDK help on USB Flash. It's pretty big (105MB), but I think it's one of must-to-have thingies.