logon script

  • Thread starter Thread starter Newbie
  • Start date Start date
N

Newbie

Hi
I have the following - both of which work fine individually
How can I re-write the 2nd command in the scripting language of the first

Set WshShell = WScript.CreateObject("WScript.Shell")
strDesktopPath = WSHShell.SpecialFolders.Item("Desktop")
Set oShellLink = WshShell.CreateShortcut(strDesktopPath & "\IT Policy.lnk")
oShellLink.TargetPath = "c:\ITPolicy.exe"
oShellLink.Save
This works fine


if exist c:\progra~1\SYSPRO60\base\ud031204.txt then goto END

copy c:\old\alison.txt c:\new\alison1.txt

:END

del c:\new\alison1.txt
 
-----Original Message-----
Hi
I have the following - both of which work fine individually
How can I re-write the 2nd command in the scripting language of the first

Set fs = CreateObject("Scripting.FileSystemObject")
Set WshShell = WScript.CreateObject("WScript.Shell")
strDesktopPath = WSHShell.SpecialFolders.Item("Desktop")
Set oShellLink = WshShell.CreateShortcut(strDesktopPath & "\IT Policy.lnk")
oShellLink.TargetPath = "c:\ITPolicy.exe"
oShellLink.Save
This works fine


if exist c:\progra~1\SYSPRO60\base\ud031204.txt then goto END
if fs.FileExists("c:\progra~1\SYSPRO60
\base\ud031204.txt") <> 0 then
set f1 = fs.GetFile("c:\old\alison.txt")
f1.copy ("c:\new\alison1.txt")
end if

copy c:\old\alison.txt c:\new\alison1.txt

:END

del c:\new\alison1.txt
set f2 = fs.GetFile ("c:\new\alison1.txt")
f2.delete
 
Back
Top