Page 1 of 1 1
Topic Options
#1414 - 2000-01-13 10:49 AM Call Command
Anonymous
Unregistered


Im using the Run/Shell command to call an NT command script
(which uses DOS commands, such as MD) from a
Kixtart script, but it does not work!

The NT command file (test.cmd)is as follows
RD /s /q "%SystemDrive%\Temp\Test\"
MD "%SystemDrive%\Temp\Test\"

At login, i want to empty the contents of the Test directory (which may also have sub directories, which i want deleted!), so everything is deleted, and then re-create it. But Kixtart does not allows this, so i have to do it through DOS, and thus saved it as 'CMD' and called it from a Kixtart script!

Then in the Kix script:

Run "test.cmd"

Does anyone have any other examples?

Top
#1415 - 2000-01-14 02:11 AM Re: Call Command
Pierre FREMION Offline
Getting the hang of it

Registered: 2000-01-11
Posts: 66
Loc: Paris, France, Europe, Sun3
DOS DELTREE command don't exist in Windows NT
To do the job execute these DOS commands

ECHO Y | DEL /F /S "dir to delete"
RD /S /Q "dir to delete" ; this delete the subdir
RD /S /Q "dir to delete" ; this delete the "root"dir

from a batch file or within a .KIX file use
SHELL 'line to execute'

_________________________
Comments always welcome. French native so I apologize for my (mis)use of English!

Top
#1416 - 2000-01-14 04:19 AM Re: Call Command
Anonymous
Unregistered


im having trouble with the
SHELL 'line to execute'

what do i put there?

Top
#1417 - 2000-01-14 08:57 AM Re: Call Command
Anonymous
Unregistered


Hi

What client? Win9x or NT?

To run a batch file in your PDC Netlogon folder try:

SHELL "\\server\NETLOGON\example.BAT"

If running an .exe file then there can be numerous ways to do this.

Hope this helps.
Rgds
Don

Top
#1418 - 2000-01-14 10:17 AM Re: Call Command
Anonymous
Unregistered


im running Windows NT, i have also tried the way you have suggested, are there any other ways! Thanks
Top
#1419 - 2000-01-15 12:07 AM Re: Call Command
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
A few points that you may find helpful.

NT does not run DOS. Do not confuse the Command Prompt in NT with the DOS Prompt in Windows 95. They are not the same. As I said, NT can not run DOS but it does contain some DOS like batch commands. Some work just like DOS but some don't. To see a list of the NT batch commands plus the syntax open this file:

c:\winnt\ntcmds.hlp

You might consider acquiring the NT Resource Kit. It greatly expands the set of batch commands, including helpful commands for copying & deleting directories.

To run an NT command, DOS bat file, com file, or exe file in kixtart you could use RUN or Shell but most of the time Shell is preferable.

I always use quotes around the input parameters for the shell command.

Pierre is suggesting you create a bat file (say in your netlogon share) containing these lines:

Deltest.bat

ECHO Y | DEL /F /S "dir to delete"
RD /S /Q "dir to delete" ; this delete the subdir
RD /S /Q "dir to delete" ; this delete the "root"dir

Then DON suggests in your kixtart script you include the line

SHELL "\\server\NETLOGON\deltest.bat"


To test this script you should input the lines from deltest.bat one at a time into the command prompt box. Keep testing until you get the syntax correct. Once you have it correct put the line in your bat file.

_________________________
Jack

Top
#1420 - 2000-01-16 02:37 PM Re: Call Command
Anonymous
Unregistered


But will the bat file recoginse the
%SystemDrive% function in the batch file?

Top
#1421 - 2000-01-16 08:00 PM Re: Call Command
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
I just dis a set command on my NT system & the environmental variable is there so it should recognize it. The easy way to verify this is by running a test script from the command prompt with "echo on" & a few pause & set commands to dump the environment variables.
_________________________
Jack

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 1607 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.095 seconds in which 0.065 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org