delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2014/04/14/20:07:01

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:in-reply-to:references:date
:message-id:subject:from:to:content-type; q=dns; s=default; b=Zs
ORG63SZX3xHBzg++SoGJYHudunJBxiS67irUaqJxemrbgRhdf67nxK3Y7wBgiTeX
x4winpECmpKQtnoLfEnV7zauCFW6pT/wNmuOz8VGj/rxBxXHBOf93untjARydGR+
xi9nKrjOygNCeBJZIXD/j3GFcXSx7gWKQPJRMdld0=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:in-reply-to:references:date
:message-id:subject:from:to:content-type; s=default; bh=a3hfm2/V
y1Nr1JqJYq2gEGXqgXs=; b=jZB+J26+DCvA2JNQ3RaHXx7FgnTu0NKp7i+yi+Wp
1LIZ3qlat6tSw62v+HGr5OknGAaElAtmIuC9PG72GEiBaQikseHSREmT4Qw8vSfE
5mg81m9obXIL6NN0XKD6MgBFUKIF4JBCSuB87k+T69k41Ab3R3CVzYTaC2vWMW1E
UDw=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=2.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2
X-HELO: mail-oa0-f47.google.com
MIME-Version: 1.0
X-Received: by 10.60.76.194 with SMTP id m2mr4639145oew.47.1397520400094; Mon, 14 Apr 2014 17:06:40 -0700 (PDT)
In-Reply-To: <2410568999.20140415032658@yandex.ru>
References: <CAKJ_xGsTh4agckE4LXozZhbEHYmRffy6HWNDYMEJ8ZfkDC=26Q AT mail DOT gmail DOT com> <534C63A5 DOT 9040704 AT cygwin DOT com> <2410568999 DOT 20140415032658 AT yandex DOT ru>
Date: Mon, 14 Apr 2014 17:06:40 -0700
Message-ID: <CAKJ_xGue=Q6H+qVboF3CpSJX0C_yzJh1Dz4jSO5Y6FrTe-ZZJg@mail.gmail.com>
Subject: Re: Windows hostname change fails in recent versions of Cygwin (since 1.7.28)
From: Wedge Jarrad <wedge DOT jarrad AT gmail DOT com>
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes

Thank you for the replies.

>>> The following command used to allow me to change the hostname of a Windows
>>> machine:
>>>
>>> wmic computersystem where name=\"$COMPUTERNAME\" call rename name=newname
>>>
>>> With new installs of Cygwin this seems to have stopped working...
>
>> OK maybe I'm just missing something but what part of the above uses Cygwin?
>
> Shell prompt.
> The user were able to execute specific command with previous versions of
> Cygwin1.dll, but unable now.

Yes, exactly. The goal is to be able to SSH to the machine and run the command
but the same error occurs when running from a local Cygwin terminal.

> @Wedge, there was some changes around handling '=', which is SUDDENLY
> considered a separator character (that is, on par with space) for CMD.exe
> batch files parameters.
> I can't recall the exact dates, sorry.

Ok, that being the case what do I need to do to make the command execute
properly? Escaping? Quotes somewhere? I'm at a bit of a loss.

> Also, is the escaping of quotation marks around computer name necessary?
> Try without them.

Seems to be necessary. I get the following error when executing without quotes
and with un-escaped quotes. Even if I hard-code the current hostname rather
than using the $COMPUTERNAME variable.

ERROR:
Description = Invalid query

-Jarrad

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019