#27618 - 2002-08-22 09:43 PM
executing a command without having a drive mapped
|
rbenz27
Lurker
Registered: 2002-08-22
Posts: 2
|
Is there a way for kixtart to execute a command line without having to map a drive first just like in a winnt script?
If i use this it works: shell "%comspec% /e:1024 /c r:\temp\scan32.exe"
But if i use this it doesn't: shell "%comspec% /e:1024 /c \\servername\test\scan32.exe"
the first one works because i mapped the drive but i want to execute the file without having to map the drive. Is this possible in kixtart? If so, can you please tell me how? Thanks.
|
|
Top
|
|
|
|
#27620 - 2002-08-22 10:45 PM
Re: executing a command without having a drive mapped
|
rbenz27
Lurker
Registered: 2002-08-22
Posts: 2
|
Hmm.. If i simply put: \\servername\temp\scan32.exe
on the WINNT login script such as myscript.bat it works but it does not work with kixtart. [ 22. August 2002, 22:47: Message edited by: rbenz27 ]
|
|
Top
|
|
|
|
#27622 - 2002-08-23 02:52 PM
Re: executing a command without having a drive mapped
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
We do this all the time with Kixtart.
Jens is correct, we do this with NT-Class machines.
code:
$hklms = 'HKEY_LOCAL_MACHINE\SOFTWARE'
$vscanlocation = "\\SERVER\is\IS_apps\Software_Applications\McAfee\antivirus\vscan4.5" $vscansp1 = "\\SERVER\IS\IS_apps\Software_Applications\McAfee\antivirus\vscan4.5Sp1"
GOSUB NEWVSCAN GOSUB VSCANSP1
;Install new version of McAFee VirusScan :newvscan ;$ReturnCode = ExistKey($HKLMS+"\Network Associates\TVD\Shared Components\VirusScan Engine\4.0.xx") ;$ReturnCode = ExistKey($HKLMS+"\Network Associates\TVD\Shared Components\Events") $returncode = ExistKey($hklms+"\Network Associates\TVD\VirusScan") ;$ReturnCode = ExistKey($HKLMS+"\McAfee\VirusScan") IF $returncode = 0 RETURN ELSE ;~~ DO NOT UPDATE LEIF IF @wksta = "1004" RETURN ELSE CLS AT ( 9,3) "There is a new version of VirusScan being installed." AT (10,3) "It may take several minutes to complete." AT (11,3) "Your system will also restart." AT (12,3) "Please be patient." SLEEP 2
RUN ($vscanlocation+"\SETUP.EXE ADDLOCAL=ALL REMOVE=SendVirus REMOVEINCOMPATIBLESOFTWARE=True REBOOT=F /q /i") $result=setconsole('show') $logshare='\\LogServer\VSDATLOG' $logdata=@date + "," + @time + "," + @userid + "," + @wksta + ",WiNNT" + Chr(13) + Chr(10) $logfile=$logshare+'\NEWSCAN.TXT' GOTO LOGGER GOTO OUT ENDIF ENDIF
;Install VirusScan SP-1 :vscansp1 ;After Vscan SP-1 is installed, we want to set screen splash to be off $skipsplash = Readvalue("HKEY_LOCAL_MACHINE\SOFTWARE\Network Associates\TVD\Shared Components\On Access Scanner\Vshield\System Scan\General","bSkipSplash") ;$SkipSplash = Readvalue("HKEY_LOCAL_MACHINE\SOFTWARE\Network Associates\TVD\Shared Components\On Access Scanner\Vshield\System Scan\General","bShowTaskbarIcon") IF @error = 0 ;Value is found - Check for modification IF $skipsplash <> 1 $rc = WriteValue("HKEY_LOCAL_MACHINE\SOFTWARE\Network Associates\TVD\Shared Components\On Access Scanner\Vshield\System Scan\General","bSkipSplash", "1", "REG_DWORD") ENDIF ENDIF ;Are they running SP-1? $scanverl = Readvalue("HKEY_LOCAL_MACHINE\SOFTWARE\Network Associates\TVD\VirusScan","szVshwin32EXE") ;Get the version of the .EXE File $scanver = GETFILEVERSION($scanverl,"FILEVERSION") ;4.5.496.0 - Version of Vshield before updating ;4.5.534.0 - Version of Vshield after updating IF $scanver = "4.5.496.0" ;Install the Application and restart the system. ;CLS ;?"We are installing SP-1 for VirusScan" ;?"Your system will restart." ;?"Thanks!" ;Sleep 2 RUN ($vscansp1+"\VSC45SP1.exe /silent") ;Log the user $result=setconsole('show') $logshare='\\LOGSERVER\VSDATLOG' $logdata=@date + "," + @time + "," + @userid + "," + @wksta + ",WiNNT" + Chr(13) + Chr(10) $logfile=$logshare+'\VSCANSP1.TXT' GOTO LOGGER ELSE ;Running the SP or not running RETURN ENDIF
:logger ;-- Log the user into a file $result=0 $n=0 DO $result=Open(1, $logfile, 5) IF $result<>0 IF $n=0 ;First wait ? "Please wait" ELSE ;follow waits "." ENDIF SLEEP 3 ELSE $result=WriteLine(1, $logdata) $result=Close(1) ENDIF $n=$n+1 UNTIL $result=0 OR $n=5 RETURN
HTH,
Kent
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 641 anonymous users online.
|
|
|