[AccessD] OT: Batch File Syntax

Paul Hartland paul.hartland at googlemail.com
Tue Sep 19 04:17:00 CDT 2017


Ignore last email about the /p

On 19 Sep 2017 08:09, "Paul Hartland" <paul.hartland at googlemail.com> wrote:

> Not done batch for a while, have you tried forward slash p after the set
> command, canf remember off hand what it does but sure I have used it for
> something
>
> So replace set ARG1UName = "fatso"
> With set /p ARG1UName = "fatso"
>
> On 19 Sep 2017 07:49, "Darren - Active Billing" <
> darren at activebilling.com.au> wrote:
>
>> Hi guys,
>>
>>
>>
>> This batch file is not quite working – Syntax is not right. When I type
>> actual values into the “net user” line it works a treat.
>>
>>
>>
>> Just the setting up of the variables and then having those variables
>> passed to the “net user” line is failing. I’ve tried a lot of variances,
>> this just happens to be the most recent.
>>
>>
>>
>> ~~~~~~~~~~~~~~~~~~~~
>>
>> @Echo off
>>
>> cls
>>
>>
>>
>> set ARG1UName = "fatso"
>>
>> set ARG2PWD = "abc123"
>>
>> set ARG3FullName = "Fatty Arbuckle"
>>
>> set ARG4Comment = "General User"
>>
>> set ARG5Group = "Administrators"
>>
>>
>>
>> net user %ARG1Uname% %ARG2PWD% /fullname:%ARG3FullName%
>> /comment:%ARG4Comment% /active:yes /passwordchg:no /add
>>
>> pause
>>
>> NET LOCALGROUP %ARG5Group% %ARG1Uname% /ADD
>>
>> pause
>>
>> ~~~~~~~~~~~~~~~~~~~~
>>
>>
>>
>>
>>
>> Can anyone assist?
>>
>>
>>
>> Many thanks in advance.
>>
>>
>>
>> Darren
>>
>> --
>> AccessD mailing list
>> AccessD at databaseadvisors.com
>> http://databaseadvisors.com/mailman/listinfo/accessd
>> Website: http://www.databaseadvisors.com
>>
>


More information about the AccessD mailing list