Created
December 7, 2010 08:52
-
-
Save bluepapa32/731596 to your computer and use it in GitHub Desktop.
Groovy+JNA
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Grab('net.java.dev.jna:jna:3.2.7') | |
import com.sun.jna.*; | |
import com.sun.jna.win32.*; | |
interface Kernel32Library extends StdCallLibrary { | |
Kernel32Library INSTANCE = Native.loadLibrary("kernel32", Kernel32Library.class); | |
boolean SetCurrentDirectoryA(String dir); | |
} | |
Kernel32Library.INSTANCE.SetCurrentDirectoryA("c:/Documents and Settings") | |
println "cmd /C cd".execute().text |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment