Search  
Thursday, May 24, 2012 ..:: Forum ::.. Register  Login
 Forum Minimize
Pentru a putea posta mesaje trebuie să vă înregistraţi.
Notă: Mesajele cu conţinut jignitor sau ilegal (inclusiv cereri de soft piratat) nu sunt acceptate şi vor fi şterse imediat .

Pentru a primi raspunsuri rapide si corecte, scrieti in mesaj ce intentionati sa faceti, ce mesaj de eroare primiti, in ce context si in urma caror actiuni. De asemenea, mentionati versiunea de FoxPro in care lucrati!
Dacă nu specificați versiunea, se consideră VFP 9.0 SP2.

SearchForum Home
  FoxPro  FoxPro 2.6 for Windows  Script vbs pent...
 Script vbs pentru FoxPro
 
 3/1/2011 7:37:18 PM
User is offlineEugenX
1 posts


Script vbs pentru FoxPro
 (N/A)
Salutare.
Este un script pe care toti utilziatorii il executa la logon, ieri a murit sistemul Windows, a trebuit sa-l reinstalez.
Acum arata asa o eroare cand utilizatorii se logheaza:

Print screen:
http://img26.imageshack.us/img26/7898/vulpe2.jpg

Script:
-----------------------------------------------------------------------

oOption Explicit

Dim objNetwork
Dim objWshShell

Dim strRemotePath, strLocalPath, strUserName
Dim strRegPath, strRegKey
' Dim strLogonPath

Set objNetwork = WScript.CreateObject("WScript.Network")
Set objWshShell = CreateObject("WScript.Shell")

strRemotePath = "\\srv01\Reprezent"
strLocalPath = "\\localhost\Profiles$\"
strUserName = objNetwork.UserName

'
strLogonPath = Left( Wscript.ScriptFullName, ( InstrRev( Wscript.ScriptFullName, "\") -1))

strRegKey = "
HKCU\Software\Microsoft\VisualFoxPro\9.0\Options\"
strRegPath = "
D:\Profiles\" & strUserName

' objWshShell.Run "
%COMSPEC% /C " & chr(34) & "IF exist T:\ ( SUBST T: /D >NUL 2>&1 ) ELSE ( SUBST T: %USERPROFILE%\Reprezent >NUL 2>&1 )" & chr(34)
objWshShell.Run "
SUBST.EXE T: " & "%USERPROFILE%\Reprezent", 0, False

objNetwork.MapNetworkDrive "
S:", strRemotePath
' objNetwork.MapNetworkDrive "
T:", strLocalPath & strUserName & "\Reprezent"

objWshShell.RegWrite strRegKey & "
_STARTUP", chr(34) & "T:" & "\reprezent.fxp" & chr(34), "REG_SZ"
objWshShell.RegWrite strRegKey & "
PATH", "T:" & "\exe\", "REG_SZ"
objWshShell.RegWrite strRegKey & "
DEFAULT", "T:" & "\tmp", "REG_SZ"
objWshShell.RegWrite strRegKey & "
TMPFILES", "T:" & "\tmp", "REG_SZ"

' objWshShell.Run "
%COMSPEC% /c " & "regedit.exe -s " & strLogonPath & "\foxik.reg", 0, False

Set objNetwork = Nothing
Set objWshShell = Nothing

----------------------------------------------------------------------

Ce parola vrea, tin sa precizez ca Grupul Everyone are full access pe folder-ul "Reprezent", poate tre sa adaug alta grupa sau un utilizator, nu prea inteleg,

Astept raspuns, mersi anticipat.

  FoxPro  FoxPro 2.6 for Windows  Script vbs pent...

Search  Forum Home         

 Google Ads Minimize

    

Copyright 2002-2010 Profox   Terms Of Use  Privacy Statement