[AccessD] Batch File Syntax

Gustav Brock gustav at cactus.dk
Tue Sep 19 06:05:50 CDT 2017


Hi Darren

No spaces, nor quotes:

@Echo off
cls
set ARG1UName=fatso
set ARG2PWD=abc123
set ARG3FullName=Fatty Arbuckle
set ARG4Comment=General User
set ARG5Group=Administrators

/gustav

-----Oprindelig meddelelse-----
Fra: AccessD [mailto:accessd-bounces at databaseadvisors.com] På vegne af Darren - Active Billing
Sendt: 19. september 2017 08:48
Til: Access Developers discussion and problem solving <accessd at databaseadvisors.com>
Emne: [AccessD] OT: Batch File Syntax

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 



More information about the AccessD mailing list