General discussion
-
CreatorTopic
-
March 6, 2001 at 1:37 pm #2117613
Windows NT Batch File
Lockedby bdhansen · about 23 years ago
I am trying to create a batch file for windows NT that will set the following parameters for me after i install windows NT.
Set the time zone to : central time zone
Set the display properties to : 1280 X 1024
Set the color to : 65536 colors
create 2 shortcuts on desktop to a program in: D:\winnt
Create a user account: user
Password : user
Set : password never expires
Set : user cannot change password
clear: user must change password at logon
Add user to power users group and make group log on as a service
Add environment variable to the Path variable: %home%\scripts;%home%\bin;%dir%\scripts;%dir%\bin
Add new variables: home=d:\dir\home
New variable : dir = d:\dir\custCould you let me know if this can be all done by usinga batch file ?
Topic is locked -
CreatorTopic
All Comments
-
AuthorReplies
-
-
March 6, 2001 at 3:46 pm #3671821
Windows NT Batch File
by mtnsqs · about 23 years ago
In reply to Windows NT Batch File
I am not sure if all this can be done from a batch file, but it obvious that you are commonly building machines with the same setup. If hardware is similar across them all, then why not look at getting GHOST from Nortons – it will let you take an image of one machine after your get the set up right, save it on your network or a CD and with an appropriate boot floppy you can then rebuild any system using the GHOST. I have used it extensively and found it saved so much time in the long run. Ihad to have about 3 or 4 basic images as we had a few different hardware setups.
-
March 12, 2001 at 12:31 pm #3699560
Windows NT Batch File
by bdhansen · about 23 years ago
In reply to Windows NT Batch File
Poster rated this answer
-
-
March 6, 2001 at 5:03 pm #3671801
Windows NT Batch File
by emcs · about 23 years ago
In reply to Windows NT Batch File
Look at Reg. It is a Freeware Command Line / Batch Registry & Environment editor. Key word is free.
REG is a handy Registry and Environment Variable batch and command line tool that supports operations on the following Registry Hives:
HKEY_LOCAL_MACHINE
HKEY_USERS
HKEY_CURRENT_USERREG will:
? Add and Delete a Registry Key.
? Add, Delete and Change a Registry Value. It supports Value Types of:REG_SZ
REG_DWORD
REG_MULTI_SZ
REG_EXPAND_SZ? Add and Delete a directory in either the SYSTEM or USER PATH.
? Setting an Environment Variable in either the SYSTEM or USER environment.
? Setting Environment and PATH variables from a file.
? Setting multiple options from a file.
? Setting a RegistryValue from the keyboard.You can download Reg from: http://www.mindspring.com/~dgthomas/index.htm.
If I understand what you want to do, between running Reg, and using some common batch file parameters, you should be able to do everthing you want.
Good luck.
dennie
-
March 12, 2001 at 12:31 pm #3699561
Windows NT Batch File
by bdhansen · about 23 years ago
In reply to Windows NT Batch File
Poster rated this answer
-
-
March 7, 2001 at 12:51 am #3670593
Windows NT Batch File
by ds9 · about 23 years ago
In reply to Windows NT Batch File
Hi,
Why not just set up a USER profile with those parameters, and copy it as needed.
George
-
March 12, 2001 at 12:31 pm #3699562
Windows NT Batch File
by bdhansen · about 23 years ago
In reply to Windows NT Batch File
Poster rated this answer
-
-
March 7, 2001 at 2:18 am #3670535
Windows NT Batch File
by shanghai sam · about 23 years ago
In reply to Windows NT Batch File
The first two answers would help in your situation. You could aslo use WINBATCH from Wilson Windowware (www.winbatch.com). It costs USD 100.
As for specific answers to your question
I do not believe the time zone and display properties can be set through a batch file.
For the shortcuts you can create them in a floppy/CD/network share and then copy them (in a batch file) to C:\winnt\profiles\AllUsers\Desktop or to a specificuser\Desktop.
Creating a user account (Next 3 lines are 1)
net user username password /add /expires:NEVER /passwordchg:no
Another option for user creation is to use the ADDUSERS Resource Kit utility
Add user to power users group use the command
net group “Power Users” username /add.
If this is a local user on a member server or a standalone server you should use
net localgroup “Power Users” username /add.
To make group log on as a service you will need to use WinBATCH or some other process.
Haven’t exactly figured out a way of automating permanent changes to environment variables. Again Winbatch will definitely help with this.-
March 12, 2001 at 12:31 pm #3699563
Windows NT Batch File
by bdhansen · about 23 years ago
In reply to Windows NT Batch File
Poster rated this answer
-
-
March 7, 2001 at 2:20 am #3670534
Windows NT Batch File
by cdcents · about 23 years ago
In reply to Windows NT Batch File
The first two answers would help in your situation. You could aslo use WINBATCH from Wilson Windowware (www.winbatch.com). It costs USD 100.
As for specific answers to your question
I do not believe the time zone and display properties can be set through a batch file.
For the shortcuts you can create them in a floppy/CD/network share and then copy them (in a batch file) to C:\winnt\profiles\AllUsers\Desktop or to a specificuser\Desktop.
Creating a user account (Next 3 lines are 1)
net user username password /add /expires:NEVER /passwordchg:no
Another option for user creation is to use the ADDUSERS Resource Kit utility
Add user to power users group use the command
net group “Power Users” username /add.
If this is a local user on a member server or a standalone server you should use
net localgroup “Power Users” username /add.
To make group log on as a service you will need to use WinBATCH or some other process.
Haven’t exactly figured out a way of automating permanent changes to environment variables. Again Winbatch will definitely help with this.-
March 7, 2001 at 2:23 am #3670533
Windows NT Batch File
by cdcents · about 23 years ago
In reply to Windows NT Batch File
Do not rate answer 4 as my session timed out while I came up with the answer.
-
March 12, 2001 at 12:31 pm #3699564
Windows NT Batch File
by bdhansen · about 23 years ago
In reply to Windows NT Batch File
Poster rated this answer
-
-
March 7, 2001 at 8:25 am #3671630
Windows NT Batch File
by mgonzales · about 23 years ago
In reply to Windows NT Batch File
I would like to recommed a bigger hammer for this solution…
-
March 12, 2001 at 12:31 pm #3699565
Windows NT Batch File
by bdhansen · about 23 years ago
In reply to Windows NT Batch File
Poster rated this answer
-
-
March 16, 2001 at 3:36 am #3694989
Windows NT Batch File
by ratnayake_j · about 23 years ago
In reply to Windows NT Batch File
I know the way to add shortcuts to the desktop, and to add the users, but the other stuff I am not sure of. If you want to know mail me.
-
April 14, 2001 at 2:38 pm #3688821
Windows NT Batch File
by bdhansen · about 22 years, 11 months ago
In reply to Windows NT Batch File
Poster rated this answer
-
-
March 18, 2001 at 7:08 pm #3696414
Windows NT Batch File
by spn · about 23 years ago
In reply to Windows NT Batch File
Why does it have to be a batch file?The best i can think of is to create a manditory policy that is copied from a shared dir on the server that will take care of most of the settings , then the short cuts are simpal enouph.
(Is this a work group or a domain?, are you runing a full NT enviorment? , the details are very important for complete and accurate answers)
-
April 14, 2001 at 2:38 pm #3688822
Windows NT Batch File
by bdhansen · about 22 years, 11 months ago
In reply to Windows NT Batch File
Poster rated this answer
-
-
April 3, 2001 at 9:28 am #3696926
Windows NT Batch File
by pbgerrard · about 23 years ago
In reply to Windows NT Batch File
It would take a lot of work to create any sort of file to do what you want to do. If we are talking about one machine I would create those settings manually.
If you are trying to create those settings on a lot of machines it is a different story. Windows NT is funny about BAT files, so you may not want to use a BAT file to do it. I would think it is possible to do, but it would take a lot of work and time. It may be faster to manually adjust the settings even if you have to adjust a whole network.
If you are willing to spend some money, you may consider purchasing Ghost or some other Symantec software. I think they make a few. That would make it exteremly easy to set up a whole network with the parameters you gave.
That is probably the best way. Ghost does not cost too much, especially considering how much work has to be put into doing it manually.Also you may be able to setup one computer like that and copy the settings to the others without Ghost, but Ghost is the best tool to use.
-
April 14, 2001 at 2:38 pm #3688823
Windows NT Batch File
by bdhansen · about 22 years, 11 months ago
In reply to Windows NT Batch File
Poster rated this answer
-
-
April 6, 2001 at 5:21 am #3889279
Windows NT Batch File
by zlatin zlatev · about 22 years, 12 months ago
In reply to Windows NT Batch File
Well not all, and not only with a batch file but it can be done
____
Legend:
*reg* – with additional REG file
*wsh* – from the Windows Scripting Host (VBScript/JScript)
*bat* – can be done in the bat file
____
*reg* Set the time zone to : central time zone
Configure one of the machines to that time zone and export the following key from registry:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]*reg* Set the display properties to : 1280 X 1024
*reg* Set the color to : 65536 colors
the same export key:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Services\i81xnt4\Device0]This key is for i810 graphic controler “i81xnt4” If your grafic controlleris different
this key will differ too(continues)
-
April 6, 2001 at 5:23 am #3889278
Windows NT Batch File
by zlatin zlatev · about 22 years, 12 months ago
In reply to Windows NT Batch File
*wsh* create 2 shortcuts on desktop to a program in: D:\winnt
There are wsh sample scripts (.VBS and .JS) that came with Windows’98 and are appliable
to Windows NT
see Shortcut.vbs*bat*
Create a user account: username
…
Add user to power users groupuse coomands like the following:
NET USER username userpass /ADD /expires:never /passwordchg:no
NET LOCALGROUP “Power Users” username /add /domainAccording to MS this should do what you need. HOWEVER it does not set the password expiration properly.
For more info see Windows NT Help – Net (command options)*???* and make group log on as a service
I’m not sure I have understand this*wsh* Add environment variable to the Path variable: %home%\scripts;%home%\bin;%dir%\scripts;%dir%\bin
see Registry.vbs
You will need api calls for reading the initial PATHstring and then append to itIf you are sure that the path will be the same for all machines you can use a reg file exported from key
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment]*reg* Add new variables: home=d:\dir\home
*reg* New variable : dir = d:\dir\cust
Use RegFile like the following (text between asterics “***”)
***
REGEDIT4[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment]
“home”=”d:\dir\home”
“dir = d:\dir\cust”
***Hope this helps,
Zlatin Zlatev, MCP -
April 6, 2001 at 5:28 am #3889274
Windows NT Batch File
by zlatin zlatev · about 22 years, 12 months ago
In reply to Windows NT Batch File
due to some “features” of TechRepublic, there are some bugs (whitespaces and line-breaks) in my answer. If you wish notify me by email to send you the solution.
Best Regards,
Zlatin Zlatev,
Programmer Mentor & Software Engineer,
JEI-Bulgaria -
April 14, 2001 at 2:38 pm #3688824
Windows NT Batch File
by bdhansen · about 22 years, 11 months ago
In reply to Windows NT Batch File
Poster rated this answer
-
-
April 11, 2001 at 8:51 am #3811859
Windows NT Batch File
by wcraigmiles · about 22 years, 11 months ago
In reply to Windows NT Batch File
Kix32 will let you set registry keys and can run during a login. Kix32 is a batch file and scripting program. Very nice.
Also, look at the sysprep and sysdif utilities. You should be able to set different setting in a text file for the individual users.
-
April 14, 2001 at 2:38 pm #3688825
Windows NT Batch File
by bdhansen · about 22 years, 11 months ago
In reply to Windows NT Batch File
Poster rated this answer
-
-
April 14, 2001 at 2:38 pm #3688820
Windows NT Batch File
by bdhansen · about 22 years, 11 months ago
In reply to Windows NT Batch File
This question was closed by the author
-
-
AuthorReplies