lamp

August 2007 - Posts

Set System Time in C#
17 August 07 10:10 AM | Frederick.Chapleau | with no comments

Declarations: 

[StructLayout(LayoutKind.Sequential)]

public struct SystemTime

{

[MarshalAs(UnmanagedType.U2)]

public short Year;

[MarshalAs(UnmanagedType.U2)]

public short Month;

[MarshalAs(UnmanagedType.U2)]

public short DayOfWeek;

[MarshalAs(UnmanagedType.U2)]

public short Day;

[MarshalAs(UnmanagedType.U2)]

public short Hour;

[MarshalAs(UnmanagedType.U2)]

public short Minute;

[MarshalAs(UnmanagedType.U2)]

public short Second;

[MarshalAs(UnmanagedType.U2)]

public short Milliseconds;

}

[DllImport("kernel32.dll")]

public static extern void GetLocalTime(

out SystemTime systemTime);

[DllImport("kernel32.dll")]

public static extern void GetSystemTime(

out SystemTime systemTime);

[DllImport("kernel32.dll")]

public static extern bool SetSystemTime(

ref SystemTime systemTime);

[DllImport("kernel32.dll")]

public static extern bool SetLocalTime(

ref SystemTime systemTime);

Usage :

SystemTime t;

GetLocalTime(out t);

// do something

SetSystemTime(ref t);

Filed under:
Error 2739 installing Google Adwords Editor in Vista
14 August 07 10:19 AM | Frederick.Chapleau | 4 comment(s)

Yes, another bug, only with vista. Saw the solution from Brent Crouch. And like all my posts, this will be short.

Start > Run ... 

regsvr32 vbscript.dll

regsvr32 jscript.dll

Restart the Installation Program

-f.

Filed under:
An other fast Q&A: SQL Server Setup cannot upgrade service ReportServer
05 August 07 06:01 PM | Frederick.Chapleau | 1 comment(s)

SQL Server Setup cannot upgrade service ReportServer. SQL Server 2005 cannot run a service account as a Local Service account or Network Service account on a domain controller.

Just change Reporting Services Account to local system, not Network Services.

-f.

Filed under:
HOWTO: Resize a VHD, in Virtual Server and Windows 2003
05 August 07 01:34 PM | Frederick.Chapleau | 1 comment(s)

Now, my basic 5 gigs disk is out of space. How do I resize it? Here are my steps:

1. Download VMResizer at http://vmtoolkit.com/files/default.aspx

2. Resize the VHD, so that you have enough space.

3. Re-point your VM to the new disk

4. Start VHDMount, using the command line interface. It is included in the R2 SP1 package, free of charge.

5. Run diskpart, included with WIndows 2003 (found that after trying Partition Magic, that is not compatible with servers)

6. Follow instructions at http://support.microsoft.com/kb/300415, for the mounted volume

7. Detatch the VHD

8. Start your VM

You're up and running! Thanks to AutoSponge.

-f.

Filed under: