Page 1 of 1 1
Topic Options
#19919 - 2002-04-15 11:30 AM Win2K copy command problem
Anonymous
Unregistered


Hi folks

I've got a problem with a very simple script I'm running with W2K - it works fine with Win98.
The problem lies with the copy command - it just doesn't work!
I'm using Kix2001 & W2K professional.
Here's the problem part of the script:

:WIN2K
copy "c:\test.dat" "C:\Documents and Settings\All Users\Application Data\Symantec\Norton AntiVirus Corporate Edition\7.5"
IF EXIST ("C:\Documents and Settings\All Users\Application Data\Symantec\Norton AntiVirus Corporate Edition\7.5\test.dat")
MessageBox("Your anti-virus software has been configured.","Norton AntiVirus 7.6 Configuration",64,10)
else
MessageBox("There has been a problem. Your anti-virus software has NOT been configured. Please report this fault to the person who supplied this package.","Norton AntiVirus 7.6 Configuration",48)
endif
goto end

I've tried different folders, different quotes, checked permissions with no joy at all...

Please help, boffins...

Gill

Top
#19920 - 2002-04-15 11:39 AM Re: Win2K copy command problem
cellnet Offline
Starting to like KiXtart

Registered: 2002-02-26
Posts: 115
Loc: Sweden
try to use
%ALLUSERPROFILE% = C:\Documents and Settings\All Users\
or:
$path="C:\Documents and Settings\All Users\Application Data\Symantec\Norton AntiVirus Corporate Edition\7.5\"

copy "c:\test.dat" "$path"

Not sure why, but It works

\erik

Top
#19921 - 2002-04-15 11:45 AM Re: Win2K copy command problem
Anonymous
Unregistered


Thanks cellnet,
That works fine now!!
Gill

Top
#19922 - 2002-04-15 06:32 PM Re: Win2K copy command problem
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Make sure the permissions are set correctly. By default only 'Administrators' can write to the 'All Users' folders and 'Users' can only read and execute.
_________________________
There are two types of vessels, submarines and targets.

Top
#19923 - 2002-04-15 06:49 PM Re: Win2K copy command problem
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
You should never assume a hard coded drive, whenever possible use a variable or read from the Registry. Remember, NT/2000/XP may not be installed on the C: drive, so hard coded entries to C: would fail. By default this location has EVERYONE FULL NTFS rights.

Here is another method of determing location.

code:
$DataLocation = READVALUE("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders", "Common AppData")
$NavGRC = "$DataLocation\Symantec\Norton AntiVirus Corporate Edition\7.5\"


Top
#19924 - 2002-04-15 06:59 PM Re: Win2K copy command problem
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
NTDOC:

I just checked three different Windows 2000 computers (two Professional, one Server, all default install with regards to secuirty settings in 'C:\Documnets and Settings/') and on those computers the 'C:\Documnets and Settings/All Users' area has 'Read & Execute' for 'Users' and 'Everyone'. So the 'copy' command in Gill's example would not work because of an 'Access denied' error.
_________________________
There are two types of vessels, submarines and targets.

Top
#19925 - 2002-04-15 07:05 PM Re: Win2K copy command problem
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
sealeopard, yes at the \Documnets and Settings\All Users location you're correct, however if you follow down the folder list to the location that Gill is using \Documents and Settings\All Users\Application Data\Symantec\Norton AntiVirus Corporate Edition\7.5, it has EVERYONE FULL rights.

[ 15 April 2002, 19:06: Message edited by: NTDOC ]

Top
#19926 - 2002-04-15 09:13 PM Re: Win2K copy command problem
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Thanks, NTDOC, I stand corrected. I should have checked the subfolders, too.
_________________________
There are two types of vessels, submarines and targets.

Top
#19927 - 2002-04-15 09:43 PM Re: Win2K copy command problem
Anonymous
Unregistered


I've been using the following lines for 9x, NT/2k for the Norton GRC.DAT file

code:
 	If @inwin=1
If Exist ("C:\Documents and Settings\All Users\Application Data\Symantec\Norton AntiVirus Corporate Edition\7.5")
Shell '%COMSPEC% /C XCOPY "\\BETHESDA\Apps$\NAV\GRC.DAT" "C:\Documents and Settings\All Users\Application Data\Symantec\Norton AntiVirus Corporate Edition\7.5" /D /H /I /R /Y > NUL'
EndIf
Else
If Exist ("C:\Program Files\Norton AntiVirus\")
Shell '%COMSPEC% /C XCOPY "\\BETHESDA\Apps$\NAV\GRC.DAT" "C:\Program Files\Norton AntiVirus\" /D /H /I /R /Y > NUL'
EndIf
EndIf


Top
#19928 - 2002-04-15 09:57 PM Re: Win2K copy command problem
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Hi mahjohn,

In general this code is okay, but Symantec changed the location depending on the version you use. Also as an FYI, it is not a good idea to hard code the drive value.

The location C:\Program Files\Norton Antivirus would be okay for Windows 9x, since it is the same in newer and older versions.
Windows XP was not supported by the earlier versions.

The XCOPY switches used are not needed. The GRC.DAT file is read and then imported into the Registry and then the file is deleted.

/D Date can not be compared (file on client should not exist)
/H File is neither Hidden or System
/I You're only copying one file, not multiple
/R File should not exist on client
/Y File should not exist on client

[ 15 April 2002, 21:59: Message edited by: NTDOC ]

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
0 registered and 1176 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.059 seconds in which 0.027 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