Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Batch script for usb F@H install
New Posts  All Forums:Forum Nav:

Batch script for usb F@H install

post #1 of 23
Thread Starter 
hey im trying to make a batch file to put on a usb drive along with the F@H console version that will copy the installation file into a new folder in another directory, install F@H(or just execute the file), and then make the folder hidden. i could probably figure it out myself but it would take me a couple days and i figured somebody here whos good at scripting could help me. Im not sure if you could get the .bat to fill in the username and team number so that it would all be automatic, but if somebody knows then let me know. thanks
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel P4 550 3.4GHz Intel ATI x800se 128mb 1GB DDR2 533, 1GB DDR2 667 
Hard DriveOSMonitorKeyboard
Maxtor 80GB x 2 Windows XP SP2 Dell 17' LCD Logitech G15 
PowerMouse
Dell stock Logitech MX518 
  hide details  
Reply
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel P4 550 3.4GHz Intel ATI x800se 128mb 1GB DDR2 533, 1GB DDR2 667 
Hard DriveOSMonitorKeyboard
Maxtor 80GB x 2 Windows XP SP2 Dell 17' LCD Logitech G15 
PowerMouse
Dell stock Logitech MX518 
  hide details  
Reply
post #2 of 23
Sorry for being stupid, but I don't know what F@H is (first result on google is Folding@Home... is that what you mean?)

I'd have to mess around with the program myself, especially since I don't know what it is. I'm guessing there is an easier way.

Just note, if what you're trying to do doesn't seem like it's going to work with a batch script (there's only so much you can do with batch these days), you may need to use a scripting language like AutoIt, AutoHotKeys, or NSIS (really an installer scripting language, but shhh!) For example, the "get the .bat to fill in the username and team number" part may need some help from an AutoIt (or like) scripting language.

I'm not sure if that really helps you much...
post #3 of 23
Thread Starter 
yea folding@home is what im talking about it. if you didnt already know overclock.net has a folding forum and a folding team, you should go check it out. i wasnt really sure about filling in the username and password but that doesnt really matter. im really just looking for something that will copy a file from its own directory into a newly created folder, make the folder hidden and then execute a file in that new folder. thats for your suggestions
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel P4 550 3.4GHz Intel ATI x800se 128mb 1GB DDR2 533, 1GB DDR2 667 
Hard DriveOSMonitorKeyboard
Maxtor 80GB x 2 Windows XP SP2 Dell 17' LCD Logitech G15 
PowerMouse
Dell stock Logitech MX518 
  hide details  
Reply
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel P4 550 3.4GHz Intel ATI x800se 128mb 1GB DDR2 533, 1GB DDR2 667 
Hard DriveOSMonitorKeyboard
Maxtor 80GB x 2 Windows XP SP2 Dell 17' LCD Logitech G15 
PowerMouse
Dell stock Logitech MX518 
  hide details  
Reply
post #4 of 23
Sorry, didn't have time to reply yesterday.
The only thing I don't know how to do is hide the folder.

In AutoIt:
Code:
DirCopy(@ScriptDir & "\\Folding@Home", @WindowsDir & "\\Folding@Home", 1)
Run(WindowsDir & "\\Folding@Home\\Name-of-Exe-to-Execute.exe")
WinWaitActive("The name of Window of the program once launched")
Send("username{TAB}password") ; Send() will send a key stroke as if you had typed it yourself. For more information about how to use Send(): http://www.autoitscript.com/autoit3/docs/functions/Send.htm
Copies Folding@Home folder to the windows install directory (which is hidden anyway). Then it will launch the program and enter the username and password (I guessed how on how the input works, you'll have to see that Send() function reference.)
To compile this script, you need AutoIt.

With a bat file, you can't send key strokes, but you can copy and launch the program using the copy command, then cd.
So, something like this:
Code:
COPY A:\\Folding@Home C:\\WINDOWS\\Folding@Home
cd C:\\WINDOWS\\Folding@Home
nameofexetoexecute.exe
(None of this code or the AutoIt code has been tested.)
post #5 of 23
Thread Starter 
thanks version. looking at the batch script it looks to me like it assumes that the usb drive is label drive A:. is there a way for the script to detect what directory it is in because the drive probably isnt the same letter on all computers
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel P4 550 3.4GHz Intel ATI x800se 128mb 1GB DDR2 533, 1GB DDR2 667 
Hard DriveOSMonitorKeyboard
Maxtor 80GB x 2 Windows XP SP2 Dell 17' LCD Logitech G15 
PowerMouse
Dell stock Logitech MX518 
  hide details  
Reply
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel P4 550 3.4GHz Intel ATI x800se 128mb 1GB DDR2 533, 1GB DDR2 667 
Hard DriveOSMonitorKeyboard
Maxtor 80GB x 2 Windows XP SP2 Dell 17' LCD Logitech G15 
PowerMouse
Dell stock Logitech MX518 
  hide details  
Reply
post #6 of 23
I haven't used batch scripts much. In the autoitscript, it autodetects it...

But, I'm sure you could do (keep it relative):
Code:
COPY Folding@Home C:\\WINDOWS\\Folding@Home
So, here's the complete code. It should work.
Code:
@echo off
TITLE Starting F@H
COPY Folding@Home C:\\WINDOWS\\Folding@Home
CD C:\\WINDOWS\\Folding@Home
winFAH.exe
pause
post #7 of 23
Planning on borging some systems are we?
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
i5 - 3570 Gigabyte GA-965P-S3 HIS 4670 IceQ 3x1GB G.Skill HK series 
Hard DriveOSMonitorKeyboard
4x1TB, 3 for storage 1 for OS Windows Vista Samsung Syncmaster 940BW -- 
PowerCaseMouse
Antec NeoPower 500W Antec P182 -- 
  hide details  
Reply
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
i5 - 3570 Gigabyte GA-965P-S3 HIS 4670 IceQ 3x1GB G.Skill HK series 
Hard DriveOSMonitorKeyboard
4x1TB, 3 for storage 1 for OS Windows Vista Samsung Syncmaster 940BW -- 
PowerCaseMouse
Antec NeoPower 500W Antec P182 -- 
  hide details  
Reply
post #8 of 23
Thread Starter 
Quote:
Originally Posted by Jimmy2Shoe View Post
Planning on borging some systems are we?
never! but if somebody were going to atleast it would be for a good cause right?

thanks alot for the help version. have you tested it out yet, im going to right now
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel P4 550 3.4GHz Intel ATI x800se 128mb 1GB DDR2 533, 1GB DDR2 667 
Hard DriveOSMonitorKeyboard
Maxtor 80GB x 2 Windows XP SP2 Dell 17' LCD Logitech G15 
PowerMouse
Dell stock Logitech MX518 
  hide details  
Reply
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel P4 550 3.4GHz Intel ATI x800se 128mb 1GB DDR2 533, 1GB DDR2 667 
Hard DriveOSMonitorKeyboard
Maxtor 80GB x 2 Windows XP SP2 Dell 17' LCD Logitech G15 
PowerMouse
Dell stock Logitech MX518 
  hide details  
Reply
post #9 of 23
Thread Starter 
well i had to mess around with your script a bit. i needed it to create a directory to put the files in. this is what it turned out to be

Code:
@echo off
TITLE Starting F@H
MD C:\\WINDOWS\\Folding
COPY FAH504-Console.exe C:\\WINDOWS\\Folding
pause
start c:\\WINDOWS\\Folding\\FAH504-Console.exe
I put this on a usb drive with the folding@home install exe. im still having trouble with it though. when it launches the setup for F@H it still creates the log and client.cfg files on the usb drive instead of the harddrive. this is what it gives me when it gets to that part

Code:
Launch directory: F:\\
Executable: c:\\WINDOWS\\Folding\\FAH504-Console.exe

[00:18:02] Configuring Folding@Home...
im guessing it creates the log and client files on the usb drive (F:\\ directory) because of the "Launch directory: F:\\". is there a way to change it so the log and client files will be created in the c:\\WINDOWS\\Folding\\ directory where the executable is that was copied there from the usb drive
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel P4 550 3.4GHz Intel ATI x800se 128mb 1GB DDR2 533, 1GB DDR2 667 
Hard DriveOSMonitorKeyboard
Maxtor 80GB x 2 Windows XP SP2 Dell 17' LCD Logitech G15 
PowerMouse
Dell stock Logitech MX518 
  hide details  
Reply
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel P4 550 3.4GHz Intel ATI x800se 128mb 1GB DDR2 533, 1GB DDR2 667 
Hard DriveOSMonitorKeyboard
Maxtor 80GB x 2 Windows XP SP2 Dell 17' LCD Logitech G15 
PowerMouse
Dell stock Logitech MX518 
  hide details  
Reply
post #10 of 23
Why not copy the install files after a clean install?

Well, the results you are getting are really weird. I don't know how I can help you.
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Batch script for usb F@H install