== Sharing Violation Issue ==

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Dos_Probie
Posts: 233
Joined: 21 Nov 2010 08:07
Location: At My Computer

== Sharing Violation Issue ==

#1 Post by Dos_Probie » 11 Dec 2012 04:21

When I run this batch, I get a Sharing Violation in the console, what's up with that?

Code: Select all

@Echo off
:: Windows(R),ProfessionalWMC edition
cd %~dp0

:: W8 GADGETS
:: Copying x64 Sidebar to "%ProgramFiles%\Windows Sidebar"...
xcopy /E /I /Y "files\x64\Windows Sidebar" "%ProgramFiles%\Windows Sidebar">nul
:: Copying x86 Sidebar to "%ProgramFiles(x86)%\Windows Sidebar"...
xcopy /E /I /Y "files\x86\Windows Sidebar" "%ProgramFiles(x86)%\Windows Sidebar">nul
:: Creating "Desktop Gadget Gallery" shortcut in the Start menu...
xcopy /Y "files\Sidebar.lnk" "%ProgramData%\Microsoft\Windows\Start Menu\Programs\">nul
wscript files\Sidebar1.vbs
wscript files\Sidebar2.vbs
if %errorlevel% NEQ 0 goto error
:: Registering Sidebar...
pushd %ProgramFiles%\Windows Sidebar
%windir%\System32\regsvr32 /s sbdrop.dll
%windir%\System32\regsvr32 /s wlsrvc.dll
popd
pushd %ProgramFiles(x86)%\Windows Sidebar
%windir%\SysWOW64\regsvr32 /s sbdrop.dll
%windir%\SysWOW64\regsvr32 /s wlsrvc.dll
popd
reg import files\Sidebar.reg>nul 2>nul
"%ProgramFiles%\Windows Sidebar\sidebar.exe" /RegServer
"%ProgramFiles(x86)%\Windows Sidebar\sidebar.exe" /RegServer
if %errorlevel% NEQ 0 goto error
:: Windows 7 Sidebar installed successfully!
goto end
:error
:end
exit


abc0502
Posts: 1007
Joined: 26 Oct 2011 22:38
Location: Egypt

Re: == Sharing Violation Issue ==

#2 Post by abc0502 » 11 Dec 2012 04:31

try adding pause after each command to know which command generate that as testing this command in another PC will be difficult.

Dos_Probie
Posts: 233
Joined: 21 Nov 2010 08:07
Location: At My Computer

Re: == Sharing Violation Issue ==

#3 Post by Dos_Probie » 11 Dec 2012 07:06

abc0502 wrote:try adding pause after each command to know which command generate that as testing this command in another PC will be difficult.

Ok, I took off the nul and added pause and seems to be a issue with the first line with a system file..

Code: Select all

files\x64\Windows Sidebar\sbdrop.dll
Sharing violation
Press any key to continue . . .

abc0502
Posts: 1007
Joined: 26 Oct 2011 22:38
Location: Egypt

Re: == Sharing Violation Issue ==

#4 Post by abc0502 » 11 Dec 2012 07:12

It seams that the dll file is locked/in use, and when you try to copy you get this message.
and to copy it you must first stop the program that uses it.

Dos_Probie
Posts: 233
Joined: 21 Nov 2010 08:07
Location: At My Computer

Re: == Sharing Violation Issue ==

#5 Post by Dos_Probie » 11 Dec 2012 22:30

Thanks abc, I got it figured out and its working good now .. :D

Post Reply