I am using VB6. The tool that i have created extracts few zip files and unzips them onto a folder that i create locally.In the clean up part of my code, i have deleted the folder using this code
If (f.FolderExists(path + "Extracted Files") = True) Then
f.DeleteFolder (path + "Extracted Files")
End If
When i run this code, i get an error Run Time Error '70' and Permission Denied in the line f.DeleteFolder(path + 'Extracted Files').
Where am i going wrong ? Or do i need to create the folder with a different permission ?
Perhaps one or more of the files is read-only? Use the optional force parameter to force deletion:
f.DeleteFolder (path + "Extracted Files"), True
You are using a library written in another language to extract the files? Verify that any pointer was open, it is likely that some file is opened, good luck!
Run Registry Editor by typing regedit in Start Search or command prompt.
In Registry Editor, navigate to the following registry key:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System
Locate the following DWORD registry subkey in the right pane: EnableLUA
Double click on EnableLUA
On value prompt, set value to 0.
Exit from Registry Editor.
Restart the computer.
To enable the UAC again, set value of EnableLUA to 1.
Related
I am usually working within the same directory (or subfolders of it) and it has quite a long path so it would be really convenient if my command prompt automatically started in that directory (instead of C:\Users\username). How can I change the starting folder to the one I want?
There are two main ways to do it:
Create a shortcut that opens CMD in the directory you want (recommended).
Create a Command Prompt shortcut
Access the properties of the shortcut and set the path where you want it to open in the "Start in" field
Change the path that the command prompt uses by default
Open regedit
Go to "Computer\HKEY_CURRENT_USER\Software\Microsoft\Command Processor"
Create a new "String Value" with the name "Autorun" and with the value "cd /d C:\EXAMPLEDIR"
I have copied system registry file C:\Windows\system32\config\system from another windows machine (VM). And I want to open it and list out some keys from "...\ControlSet.." I open the Regedit and tried to open it but Regedit showing me the option of import which giving the warning that the registry keys ill be get replaced.
So I want to open it with PowerShell if not possible then want some tool to open the file and list out the required keys from it.
In your PowerShell script, you can use reg load/unload to automate what you described above.
$null = reg load HKU\CustomFolderName "c:\path\SYSTEM.DAT"
...
script code here
...
$null = reg unload HKU\CustomFolderName
Found one way is using Load Hive Option in Regedit.
Select the Hive HKEY_LOCAL_MACHINE or HKEY_USERS then
'File > Load Hive' then select the file to load then
Write the path or name of the key in the opened dialog box.
If the key does not exist in the selected hive it will create key and will load the
selected file under it.
See image here ->
I am trying to delete "Games" folder. Folder size is huge. But it's not deleting. Even not showing a message.
If I try to delete using cmd. But it shows another error:
See image here ->
What should I do now?
I have used " chkdsk D: /f " this command and it made that folder removable.
To remove a folder or anything from within the command prompt you have to use the word "del than the folder or file name" and not rm that is a unix command. Since your in Windows you could just right click on the folder in the file explorer and click on delete from the context menu.
I'm having a problem with scheduling a task in Windows 7
I m creating a task which is mapped to a bat file to execute,
here is my .bat file :
cd "C:\soft\"
Start excel "" "AD Auto Run.xlsm"
its working automaticaly and manually when the option (radio button) "Run only when the user is logged on" is selected.
but the automatic/manual RUN is not working when the option (radio button) "Run whether user logged on or not" is selected.
I resolved the issue by performing these steps:
Create the empty Desktop folders at the below path:
C:\Windows\System32\config\systemprofile\Desktop C:\Windows\SysWOW64\config\systemprofile\Desktop
Make sure user has “log on as batch job” permission.
To enable this please follow below steps:
a) Go to the Start menu.
b) Type secpol.msc. and press Enter.
c) The Local Security Policy manager opens.
d) Go to Security Settings - Local Policies - User Rights Assignment node.
e) Double click Log on as a batch job on the right side.
f) Click Add User or Group.
g) Select the user.
h) Click OK.
Create a file and save it with .cmd extension. The .cmd file should contain below cmd:
cscript.exe “<path to .vbs file>”
In the scheduler, give the path as follows:
• Program/script: filename (.cmd filename)
• Start in(optional): file path (path to .cmd file)
Check the mapped drive in your batch file, by adding a diagnostic command after you map the drive.
Assuming M: is the mapped drive:
if exist "M:\soft\AD Auto Run.xlsm" (
>>"c:\folder with write permissions\file.log" echo map ok
) else (
>>"c:\folder with write permissions\file.log" echo map FAILED
)
I made some changes and it appears to work like a charm. The issue like I previously stated that the excel is creating some issue.
I found that the excel file was not able to save the record set output when the user account is logged off.
So You have to create a folder (or two on a 64bit-windows):
(32Bit, always)
C:\Windows\System32\config\systemprofile\Desktop
(64Bit)
C:\Windows\SysWOW64\config\systemprofile\Desktop
After creation of the folder, my program is working fine.
I would like to add an entry to the Windows right-click menu that only appears when I right click on a .exe or .msi file. If the entry is selected, the exe file will be executed (like Open) but with a fixed text string as its argument.
I guess this should be possible with a registry key - any ideas how to do this?
For an .exe file, you can do the following in the registry:
Under HKEY_Classes_Root, find key .exe
Read the (Default) value (this is usually exefile)
Under HKEY_Classes_Root, find key exefile (or whatever you found in step 2)
Under exefile\shell create a new key, with a name matching what you want to see in the context menu (say, "Open With My App")
Under your new key, create a new key called command
Set the (Default) value of this key to whatever commandline you want to execute. The name of the file you clicked on can be entered using the token %1. So, for example, you could set the value to notepad.exe %1 to edit the executable in Notepad.
A similar pattern will work for other file types.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.exe\shell\Copy Address\command]
#="C:\\Windows\\CopyAddress.exe %1 "
[HKEY_CLASSES_ROOT\.msi\shell\Copy Address\command]
#="C:\\Windows\\CopyAddress.exe %1 "
Change path and menu name(CopyAddress) as per your choice.