Remotly launch a batch file on a Windows computer

Here’s a tip for remotly executing a command on a Windows computer in your network (supposing the target computer has allowed remote connections -NDMyself: this is to be checked…-). Suppose you want to run a batch file on a Windows computer called \\targetMachine. Suppose the batch file to execute is stored on a shared drive. Suppose a user on the target machine is created with login “toto” & password “myPassword”. Then the following batch executed from any computer in the network will run the test.bat file on the computer named “targetMachine”

Here’s the code:
set machine=targetMachine
set file=\\eici01\user\FMA\test.bat
set user=toto
set userPwd=myPassword
set executeAs=%user%
set executeAsPwd=%userPwd%
schtasks /Create /S %machine% /U %user% /P %userPwd% /RU %executeAs% /RP %executeAsPwd% /SC ONCE /TN install /TR %file% /ST 00:00:00
schtasks /Run /S %machine% /U %user% /P %userPwd% /TN install
pause

(tested on Windows XP SP2)

  • Updated on 2009-07-01, thanks to Sasquatch, corrected “set executeAsPwd=%user%” as “set executeAsPwd=%userPwd%”
  • Updated on 2009-12-26, thanks to Neiv, correctly renamed the targetMachine in the code
Advertisements

GroowinLauncher: win utility for your USB key

I’ve just released a small utility I’ve made. It ‘s named GroowinLauncher because it is made in Groovy and it creates a small icon in your taskbar to allow you to launch easily your favourite apps. Recently, I switched a lot from computers to computers having to modify a lot of files. I was tired to always have to bring my favourite softwares with me (namely Winmerge, Notepad++ and 7zip) to do my job. Moreover, my USB key is very slowwwwwwww & it was a pain to copy the softs. And, last but not least, I wanted to always have a Java & Groovy dev environment in order to be able to quickly develop small utility or batch process some files.

So I created my own launcher which:

  1. contains my favourite softwares & Java / Groovy environment
  2. is designed to be installed from slowww USB devices
  3. sits in the taskbar to allow to launch the softwares easily
  4. does not pollute the computer (it installs itself in Windows %TEMP% dir and that’s all)
  5. you can add your own app by editing a simple XML file and 7zipping it

Here’s how it looks:

GroowinLauncher a groovy utility

So download this file: GroowinLauncher-1.0.zip and unzip it on your USB key. Then, when you want to install it on the %TEMP% dir of the computer, just double click on InstallToTMP.bat. It will automatically copy, unzip & run the required files, then launch the launcher (!).

If you ever need a Java or Groovy dev environment, just:

  1. run a command shell (start menu -> run -> cmd )
  2. type “cd /D %TEMP%\GroowinLauncher\”
  3. execute the setenv.bat command
  4. that’s it, you can run & use Groovy !

(tested on Windows XP SP2, the Groovy version provided is 1.5.4 & Java is Java6u3)

Convert a PDF into a Word .doc file

My girlfriend Violaine is finishing its thesis. She has published articles in magazines during this thesis and wanted to add those PDF articles, as published in the magazines, in its final thesis doc. I was not able to find any automatic way to put a PDF into a Word document, so I decided to create mine.

The following method could be used too in order to print protected PDF (but you should not do it !)

Here are the file you need to download:

Readme.txt
AddImages.doc
ExtractImages.bat

You can go to this website for updated documentation: http://fraaargh.free.fr/Files/PDF2Word/