Friday, October 31, 2008

Remote Windows Service control

The command line way of controlling windows services is to use the net start and net stop commands. This will not work for remote servers though.

Instead we use the sc command. If I want to stop a service on GR0409A1, write:

sc \\gr0409a1 stop "Sonic CT_H1_ARN_StartGR0409A1 Service (AtlasProd)"


Also we can configure services with the sc command. To configure a service to autostart:

sc config "Sonic CT_H1_ACN_StartAtlasFileTransfer Service (LocalTest)" start= auto


This will work at least on XP.

Thursday, October 23, 2008

Rename files

I often have to rename files with the additional file extention .reject.
I basically just want to remove the .reject extention and keep the rest of the file.

This is the typical dirctory listing
C:\Apps>dir \\seit1705\D-Share\test\
 Volume in drive \\seit1705\D-Share is SEIT1705
 Volume Serial Number is 78E4-8FB3

 Directory of \\seit1705\D-Share\test

 2008-10-23  13:25  .
 2008-10-23  13:25  ..
 2007-10-03  16:45  1 144 E_DepSub_RME.xml.reject
 2007-10-03  16:45  1 144 E_DepSub_RME1.xml.reject
 2007-10-03  16:45  1 144 E_DepSub_RME2.xml.reject
 2007-10-03  16:45  1 144 E_DepSub_RME3.xml.reject
               4 File(s)          4 576 bytes
               2 Dir(s)  15 828 320 256 bytes free

You would think that this would do it:

ren \\seit1705\D-Share\test\*.reject *

But no... that command does NOTHING.

Ok, what about this:
ren \\seit1705\D-Share\test\*.reject *.xml


Nope, it produces this:
C:\Apps>dir \\seit1705\D-Share\test\
 Volume in drive \\seit1705\D-Share is SEIT1705
 Volume Serial Number is 78E4-8FB3

 Directory of \\seit1705\D-Share\test

2008-10-23  14:47              .
2008-10-23  14:47              ..
2007-10-03  16:45             1 144 E_DepSub_RME.xml.xml
2007-10-03  16:45             1 144 E_DepSub_RME1.xml.xml
2007-10-03  16:45             1 144 E_DepSub_RME2.xml.xml
2007-10-03  16:45             1 144 E_DepSub_RME3.xml.xml


Not what we want.

Solution:

ren \\seit1705\D-Share\test\*reject *xml


Amazingly works!

Saturday, October 4, 2008

Permanently mounting NTFS partition

I have a data partition that is NTFS formatted. I could mount it previously, but it was not automounted.

To fix this, I did the following:
1. got the graphical config program for ntfg-3g with:
sudo apt-get install ntfs-config
2. backed up my current /etc/fstab with:
sudo cp /etc/fstab /etc/fstab.orig
3. checked the mount info with:
sudo blkid
4 ran the config program that does the mounting with:
gksudo ntfs-config
5. I chose the correct partion to mount and the chose to make it writable.

... done!

No problems so far.

Wednesday, October 1, 2008

Way to go Logitech!

When the H&M moved their offices to Marievik, the moving boys lost the USB stick to my MXRevolution mouse. I was PISSED!

I called Logitech support to check if it was possible to buy a replacement somewhere. Instead they sent me a replacement for free! I am sitting stunned looking at the replacement right now!

Thumbs up and three cheers for Logitech!

Edit: Unfortunately they sent me the wrong USB stick.... a new one is on the way...

Edit: Three month later and I still haven't gotten the stick. I am now completely disappointed with Logitech.