public ShellLink saveTo(String path) throws IOException {
		linkFileSource = Paths.get(path).toAbsolutePath().normalize();
		if (Files.isDirectory(linkFileSource))
			throw new IOException("path is directory!");
		
		if (!header.getLinkFlags().hasRelativePath()) {
			Path target = Paths.get(resolveTarget());
			Path origin = linkFileSource.getParent();
			if (target.getRoot().equals(origin.getRoot())) 
				setRelativePath(origin.relativize(target).toString());
		}
		
		if (!header.getLinkFlags().hasWorkingDir()) {
			Path target = Paths.get(resolveTarget());
			if (!Files.isDirectory(target))
				setWorkingDir(target.getParent().toString());
		}
		
		serialize(Files.newOutputStream(linkFileSource));
		return this;
	}