Hello,
I dont know if i'm evening posting this in the correct section, but its a very basic script issue im having, im just clueless on this scripts. I'm using visual basic, and I've attached the code below, i took over the admin position here, so i got to try to figure out why this code is not deleting the (3) listed files at the bottom of the code fand copying them from the server ( waps-dc2) to the user's windows folder, they're was alot more to this code but i reduced it since this is where the issue is
'*********************************************************
' Declare Vars
'*********************************************************
DIM wshNet
DIM strUser
DIM datadir
dim windir
DIM drivetally
Set DriveNet = WScript.CreateObject("WScript.Network")
Set CheckDrive = DriveNet.EnumNetworkDrives()
Set wshNet = WScript.CreateObject("WScript.Network")
Set fso = CreateObject("Scripting.FileSystemObject")
Set wshShell = WScript.CreateObject("WScript.Shell")
DriveLetter = "P:"
strUser = wshNet.UserName
startDir = "C:\Documents and Settings\" & strUser & "\Start Menu\Programs\"
deskDir = "C:\Documents and Settings\" & strUser & "\Desktop\"
winDir= "C:\Documents and Settings\" & strUser & "\WINDOWS\"
dataDir = "\\WAPS-dc1\" & strUser &"$"
'*********************************************************
' STARREADING - 11/07/06, 01/23/07
'*********************************************************
if fso.FileExists(winDir) then
if fso.FileExists(winDir & "ALSBIGC.DAT") Then
set DelShort = fso.GetFile(winDir & "ALSBIGC.DAT")
DelShort.Delete
end if
if fso.FileExists(winDir & "ALSBIGC.FPT") Then
set DelShort = fso.GetFile(winDir & "ALSBIGC.FPT")
DelShort.Delete
end if
if fso.FileExists(winDir & "ALSPREFS.INI") Then
set DelShort = fso.GetFile(winDir & "ALSPREFS.INI")
DelShort.Delete
end if
fso.CopyFile "\\waps-dc2\starfiles$\ALSBIGC.DAT", winDir
fso.CopyFile "\\waps-dc2\starfiles$\ALSBIGC.FPT", winDir
fso.CopyFile "\\waps-dc2\starfiles$\ALSPREFS.INI", winDir
End if
'*********************************************************
' End of Script
Josh McMahon
A+ Certified,CCNA
Josh McMahon
A+ Certified,CCNA
sold@joshmcmahon.com
I dont know if i'm evening posting this in the correct section, but its a very basic script issue im having, im just clueless on this scripts. I'm using visual basic, and I've attached the code below, i took over the admin position here, so i got to try to figure out why this code is not deleting the (3) listed files at the bottom of the code fand copying them from the server ( waps-dc2) to the user's windows folder, they're was alot more to this code but i reduced it since this is where the issue is
'*********************************************************
' Declare Vars
'*********************************************************
DIM wshNet
DIM strUser
DIM datadir
dim windir
DIM drivetally
Set DriveNet = WScript.CreateObject("WScript.Network")
Set CheckDrive = DriveNet.EnumNetworkDrives()
Set wshNet = WScript.CreateObject("WScript.Network")
Set fso = CreateObject("Scripting.FileSystemObject")
Set wshShell = WScript.CreateObject("WScript.Shell")
DriveLetter = "P:"
strUser = wshNet.UserName
startDir = "C:\Documents and Settings\" & strUser & "\Start Menu\Programs\"
deskDir = "C:\Documents and Settings\" & strUser & "\Desktop\"
winDir= "C:\Documents and Settings\" & strUser & "\WINDOWS\"
dataDir = "\\WAPS-dc1\" & strUser &"$"
'*********************************************************
' STARREADING - 11/07/06, 01/23/07
'*********************************************************
if fso.FileExists(winDir) then
if fso.FileExists(winDir & "ALSBIGC.DAT") Then
set DelShort = fso.GetFile(winDir & "ALSBIGC.DAT")
DelShort.Delete
end if
if fso.FileExists(winDir & "ALSBIGC.FPT") Then
set DelShort = fso.GetFile(winDir & "ALSBIGC.FPT")
DelShort.Delete
end if
if fso.FileExists(winDir & "ALSPREFS.INI") Then
set DelShort = fso.GetFile(winDir & "ALSPREFS.INI")
DelShort.Delete
end if
fso.CopyFile "\\waps-dc2\starfiles$\ALSBIGC.DAT", winDir
fso.CopyFile "\\waps-dc2\starfiles$\ALSBIGC.FPT", winDir
fso.CopyFile "\\waps-dc2\starfiles$\ALSPREFS.INI", winDir
End if
'*********************************************************
' End of Script
Josh McMahon
A+ Certified,CCNA
Josh McMahon
A+ Certified,CCNA
sold@joshmcmahon.com