Bat file works on C drive to delete registry, but it doesn't delete them when run on network drive





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















I have a .bat file that deletes the login username from Windows 10, so when they log off their name won't appear. I did it by changing the registry:



It works when I run it from my C drive, but it doesn't delete the registry when I run it from my network drive called U from the server.



 echo Resetting last logged on username.
set id = example
%SystemRoot%System32reg.exe DELETE HKLMSoftwareMicrosoftWindowsCurrentVersionAuthenticationLogonUI /v LastLoggedOnUserSID /f
%SystemRoot%System32reg.exe DELETE HKLMSoftwareMicrosoftWindowsCurrentVersionAuthenticationLogonUI /v LastLoggedOnDisplayName /f
echo y|%SystemRoot%System32reg.exe ADD HKLMSoftwareMicrosoftWindowsCurrentVersionAuthenticationLogonUI /v LastLoggedOnUser /d %id% /f
echo y|%SystemRoot%System32reg.exe ADD HKLMSoftwareMicrosoftWindowsCurrentVersionAuthenticationLogonUI /v LastLoggedOnSAMUser /d %id% /f
PAUSE









share|improve this question


















  • 3





    How did you run it from the server? Also, there's a setting you can set by Group Policy which tells Windows not to show the previous session's username. This would be the correct way to accomplish what you're trying here: docs.microsoft.com/en-us/windows/security/threat-protection/…

    – music2myear
    Feb 6 at 20:06













  • What I meant with run it from the server is that I ran it from my network drive. I can't change the policy because we want the users to have their username in their computers, but as a tech I have to go to their computers to help them but sometimes they lock my account by trying to login thinking they are in their account.

    – Gabriel Fernandez
    Feb 6 at 20:10











  • What error(s) or ouput do you get when you run this from the network drive? Have you tried using PowerShell to do this: docs.microsoft.com/en-us/powershell/scripting/samples/…

    – music2myear
    Feb 6 at 20:18








  • 2





    Try using the UNC path location to the file so with its full UNC path and file name and see if that helps any. So use something like ... \servernamesharenamefolderscript.bat

    – Pimp Juice IT
    Feb 6 at 20:44


















0















I have a .bat file that deletes the login username from Windows 10, so when they log off their name won't appear. I did it by changing the registry:



It works when I run it from my C drive, but it doesn't delete the registry when I run it from my network drive called U from the server.



 echo Resetting last logged on username.
set id = example
%SystemRoot%System32reg.exe DELETE HKLMSoftwareMicrosoftWindowsCurrentVersionAuthenticationLogonUI /v LastLoggedOnUserSID /f
%SystemRoot%System32reg.exe DELETE HKLMSoftwareMicrosoftWindowsCurrentVersionAuthenticationLogonUI /v LastLoggedOnDisplayName /f
echo y|%SystemRoot%System32reg.exe ADD HKLMSoftwareMicrosoftWindowsCurrentVersionAuthenticationLogonUI /v LastLoggedOnUser /d %id% /f
echo y|%SystemRoot%System32reg.exe ADD HKLMSoftwareMicrosoftWindowsCurrentVersionAuthenticationLogonUI /v LastLoggedOnSAMUser /d %id% /f
PAUSE









share|improve this question


















  • 3





    How did you run it from the server? Also, there's a setting you can set by Group Policy which tells Windows not to show the previous session's username. This would be the correct way to accomplish what you're trying here: docs.microsoft.com/en-us/windows/security/threat-protection/…

    – music2myear
    Feb 6 at 20:06













  • What I meant with run it from the server is that I ran it from my network drive. I can't change the policy because we want the users to have their username in their computers, but as a tech I have to go to their computers to help them but sometimes they lock my account by trying to login thinking they are in their account.

    – Gabriel Fernandez
    Feb 6 at 20:10











  • What error(s) or ouput do you get when you run this from the network drive? Have you tried using PowerShell to do this: docs.microsoft.com/en-us/powershell/scripting/samples/…

    – music2myear
    Feb 6 at 20:18








  • 2





    Try using the UNC path location to the file so with its full UNC path and file name and see if that helps any. So use something like ... \servernamesharenamefolderscript.bat

    – Pimp Juice IT
    Feb 6 at 20:44














0












0








0


1






I have a .bat file that deletes the login username from Windows 10, so when they log off their name won't appear. I did it by changing the registry:



It works when I run it from my C drive, but it doesn't delete the registry when I run it from my network drive called U from the server.



 echo Resetting last logged on username.
set id = example
%SystemRoot%System32reg.exe DELETE HKLMSoftwareMicrosoftWindowsCurrentVersionAuthenticationLogonUI /v LastLoggedOnUserSID /f
%SystemRoot%System32reg.exe DELETE HKLMSoftwareMicrosoftWindowsCurrentVersionAuthenticationLogonUI /v LastLoggedOnDisplayName /f
echo y|%SystemRoot%System32reg.exe ADD HKLMSoftwareMicrosoftWindowsCurrentVersionAuthenticationLogonUI /v LastLoggedOnUser /d %id% /f
echo y|%SystemRoot%System32reg.exe ADD HKLMSoftwareMicrosoftWindowsCurrentVersionAuthenticationLogonUI /v LastLoggedOnSAMUser /d %id% /f
PAUSE









share|improve this question














I have a .bat file that deletes the login username from Windows 10, so when they log off their name won't appear. I did it by changing the registry:



It works when I run it from my C drive, but it doesn't delete the registry when I run it from my network drive called U from the server.



 echo Resetting last logged on username.
set id = example
%SystemRoot%System32reg.exe DELETE HKLMSoftwareMicrosoftWindowsCurrentVersionAuthenticationLogonUI /v LastLoggedOnUserSID /f
%SystemRoot%System32reg.exe DELETE HKLMSoftwareMicrosoftWindowsCurrentVersionAuthenticationLogonUI /v LastLoggedOnDisplayName /f
echo y|%SystemRoot%System32reg.exe ADD HKLMSoftwareMicrosoftWindowsCurrentVersionAuthenticationLogonUI /v LastLoggedOnUser /d %id% /f
echo y|%SystemRoot%System32reg.exe ADD HKLMSoftwareMicrosoftWindowsCurrentVersionAuthenticationLogonUI /v LastLoggedOnSAMUser /d %id% /f
PAUSE






batch-file






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Feb 6 at 20:02









Gabriel FernandezGabriel Fernandez

61




61








  • 3





    How did you run it from the server? Also, there's a setting you can set by Group Policy which tells Windows not to show the previous session's username. This would be the correct way to accomplish what you're trying here: docs.microsoft.com/en-us/windows/security/threat-protection/…

    – music2myear
    Feb 6 at 20:06













  • What I meant with run it from the server is that I ran it from my network drive. I can't change the policy because we want the users to have their username in their computers, but as a tech I have to go to their computers to help them but sometimes they lock my account by trying to login thinking they are in their account.

    – Gabriel Fernandez
    Feb 6 at 20:10











  • What error(s) or ouput do you get when you run this from the network drive? Have you tried using PowerShell to do this: docs.microsoft.com/en-us/powershell/scripting/samples/…

    – music2myear
    Feb 6 at 20:18








  • 2





    Try using the UNC path location to the file so with its full UNC path and file name and see if that helps any. So use something like ... \servernamesharenamefolderscript.bat

    – Pimp Juice IT
    Feb 6 at 20:44














  • 3





    How did you run it from the server? Also, there's a setting you can set by Group Policy which tells Windows not to show the previous session's username. This would be the correct way to accomplish what you're trying here: docs.microsoft.com/en-us/windows/security/threat-protection/…

    – music2myear
    Feb 6 at 20:06













  • What I meant with run it from the server is that I ran it from my network drive. I can't change the policy because we want the users to have their username in their computers, but as a tech I have to go to their computers to help them but sometimes they lock my account by trying to login thinking they are in their account.

    – Gabriel Fernandez
    Feb 6 at 20:10











  • What error(s) or ouput do you get when you run this from the network drive? Have you tried using PowerShell to do this: docs.microsoft.com/en-us/powershell/scripting/samples/…

    – music2myear
    Feb 6 at 20:18








  • 2





    Try using the UNC path location to the file so with its full UNC path and file name and see if that helps any. So use something like ... \servernamesharenamefolderscript.bat

    – Pimp Juice IT
    Feb 6 at 20:44








3




3





How did you run it from the server? Also, there's a setting you can set by Group Policy which tells Windows not to show the previous session's username. This would be the correct way to accomplish what you're trying here: docs.microsoft.com/en-us/windows/security/threat-protection/…

– music2myear
Feb 6 at 20:06







How did you run it from the server? Also, there's a setting you can set by Group Policy which tells Windows not to show the previous session's username. This would be the correct way to accomplish what you're trying here: docs.microsoft.com/en-us/windows/security/threat-protection/…

– music2myear
Feb 6 at 20:06















What I meant with run it from the server is that I ran it from my network drive. I can't change the policy because we want the users to have their username in their computers, but as a tech I have to go to their computers to help them but sometimes they lock my account by trying to login thinking they are in their account.

– Gabriel Fernandez
Feb 6 at 20:10





What I meant with run it from the server is that I ran it from my network drive. I can't change the policy because we want the users to have their username in their computers, but as a tech I have to go to their computers to help them but sometimes they lock my account by trying to login thinking they are in their account.

– Gabriel Fernandez
Feb 6 at 20:10













What error(s) or ouput do you get when you run this from the network drive? Have you tried using PowerShell to do this: docs.microsoft.com/en-us/powershell/scripting/samples/…

– music2myear
Feb 6 at 20:18







What error(s) or ouput do you get when you run this from the network drive? Have you tried using PowerShell to do this: docs.microsoft.com/en-us/powershell/scripting/samples/…

– music2myear
Feb 6 at 20:18






2




2





Try using the UNC path location to the file so with its full UNC path and file name and see if that helps any. So use something like ... \servernamesharenamefolderscript.bat

– Pimp Juice IT
Feb 6 at 20:44





Try using the UNC path location to the file so with its full UNC path and file name and see if that helps any. So use something like ... \servernamesharenamefolderscript.bat

– Pimp Juice IT
Feb 6 at 20:44










0






active

oldest

votes












Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1402837%2fbat-file-works-on-c-drive-to-delete-registry-but-it-doesnt-delete-them-when-ru%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Super User!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1402837%2fbat-file-works-on-c-drive-to-delete-registry-but-it-doesnt-delete-them-when-ru%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Plaza Victoria

Puebla de Zaragoza

Musa