Jump to content

setting path and adding a user


Recommended Posts

maybe someone can look at my code and see if they can spot a problem

this is an excerpt from my RunOnceEX file

REG ADD %KEY%\015 /VE /D "Updating Path" /f
REG ADD %KEY%\015 /V 1 /D "%systemdrive%\install\Chpth.cmd" /f

REG ADD %KEY%\035 /VE /D "Add a User" /f
REG ADD %KEY%\035 /V 1 /D "%systemdrive%\install\user.cmd" /f

and the correspondng cmd files

path

PATH=%PATH%;%systemdrive%\perl\bin

Add user

@echo off
perl user.plx

and finally the perl code

#!/usr/bin/perl
use warnings;
use strict;



print "Please enter a username: ";
my $name = <STDIN>;
chomp $name;


print "Please enter a password: ";
my $password = <STDIN>;
chomp $password;
print "\n";

print "Thank You\n";

system "net user $name $password /add";
system "net localgroup Administrators $name /add";
system "net accounts /maxpwage:unlimited";

I have a feeling these the path and add user problem lies in the fact that if the path doesn't work neither will the add user (since it needs to know where perl is). Because I can run it (the perl file) locally and it works.

Thanks for taking the time to look at this.

Edited by pcdreams
Link to comment
Share on other sites


thank you. Is pathman already there or is there someplace I can download it?
You got to download it. Start with clicking on pathman in my previous post :)

Added. I think it's packed in MSI, just install the MSI and you'll find pathman in system32. Drop pathman.exe into your OEM folders and enjoy :)

Edited by Vadikan
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...