View Single Post
Old 03-01-2009, 01:47 PM   #6 (permalink)
n0nsensical
Junkie
 
Location: San Francisco
I don't know about converting BATs to EXEs, but here is a C program that does exactly the same thing. You can compile it yourself (Visual Studio Express and GCC are both good free compilers) or I've provided an executable version here. [SHA-1 = 4af0b5abc1a3fe20eb2a8a12902db2641c8a7505] You can trust me. ;-) (Of course, as you probably know, you shouldn't run random programs provided by random people on the internet, not least of all because even a perfectly clean program can be hacked and replaced with no one knowing, at least if they were to edit the hash.) It must be on the same drive letter as X:\PortableApps\Skype\App\skype.exe

Code:
#include <windows.h>
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
	STARTUPINFO si;
	PROCESS_INFORMATION pi;

	ZeroMemory(&si, sizeof(si));
	si.cb = sizeof(si);
	ZeroMemory(&pi, sizeof(pi));

	SetCurrentDirectory(TEXT("\\PortableApps\\Skype\\App"));
	if (!CreateProcess(NULL, 
		TEXT("skype.exe /datapath:\"Data\" /removable"),
		NULL, NULL, FALSE, 0, NULL,
		NULL, &si, &pi))
	{
		char errbuf[128];
		wsprintfA(errbuf, "CreateProcess failed [%d]\r\n", GetLastError());
		MessageBoxA(NULL, errbuf, "error", MB_OK);
		return 1;
	}

	CloseHandle(pi.hProcess);
	CloseHandle(pi.hThread);
	return 0;
}
Isn't Windows programming just a barrel of monkeys?
__________________
"Prohibition will work great injury to the cause of temperance. It is a species of intemperance within itself, for it goes beyond the bounds of reason in that it attempts to control a man's appetite by legislation, and makes a crime out of things that are not crimes. A Prohibition law strikes a blow at the very principles upon which our government was founded." --Abraham Lincoln
n0nsensical is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37