Run it like this, from CMD:
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass script.ps1
Run it like this, from CMD:
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass script.ps1
There is a way:
If all of your settings are correct but you still get the popup saying that macros are disabled, your OTM file — the VBA project file — is corrupt. In the case of Outlook:
C:\Users\[user]AppData\Roaming\Microsoft\Outlook
Seems like certain VBScript references are being ripped off of the Web; thus it was great to see this:
Two very interesting and related developments:
It’s not very much documented, but if you have a lot of WordPerfect files, try renaming their extensions to .DOC. Word will load them, unless they are very old files from WordPerfect for DOS.
If you have a huge tree of WPD files, use a batch file like this:
For /R "X:\TOP_OF_TREE" %%G in (.) Do ( Pushd %%G Echo now in %%G ren *.wpd *.doc Popd ) Echo "Done!"
Try this:
Try this:
Dim objNetwork Set objNetwork = CreateObject("WScript.Network") Dim objWinntComp Set objWinntComp = GetObject("WinNT://" & objNetwork.UserDomain & "/" & objNetwork.ComputerName & ",computer") MsgBox "WinNT://" & objNetwork.UserDomain & "/" & objNetwork.ComputerName & ",computer" Dim strGroupToCheck strGroupToCheck = "GROUP_TO_DETECT" If IsMemberOfGroup(objNetwork.UserDomain, objWinntComp, strGroupToCheck) = True Then MsgBox "You are a member of " & strGroupToCheck ElseIf IsMemberOfGroup(objNetwork.UserDomain, objWinntComp, strGroupToCheck) = False Then MsgBox "You are NOT a member of " & strGroupToCheck WScript.Quit ElseIf IsMemberOfGroup(objNetwork.UserDomain, objWinntComp, strGroupToCheck) = "Error" Then MsgBox "There was no group found called " & strGroupToCheck WScript.Quit End If Function IsMemberOfGroup(strUserDomain, objComp, strGroup) 'the user is a member of a specified group IsMemberOfGroup = False Dim objGroup On Error Resume Next Set objGroup = GetObject("WinNT://" & strUserDomain & "/" & strGroup & ",group") If Err.Number Then IsMemberOfGroup = "Error" Else IsMemberOfGroup = objGroup.IsMember(objComp.ADsPath & "$") End If End Function
Try this:
@echo off for /D %%Q in (C:\*) do echo Directory: %%Q for %%Q in (C:\*) do echo File: %%Q
The above is a solid batch file — if you use the logic in the command shell, use single percents, not doubles!
The below is revised from here. It works well, as long as a reference to the Microsoft Office [currentversion] Type Library is created. This is confirmed to work well in Access 2010.
Public Function ChooseFile() As String With Application.FileDialog(msoFileDialogFilePicker) .AllowMultiSelect = False 'Select only one file .Title = "Choose file" 'Set dialog title .ButtonName = "Choose" 'Set the button caption '.Filters.Clear 'Make sure the filter list is clear 'Add 2 filters '.Filters.Add "JPEGs", "*.jpg" '.Filters.Add "Bitmaps", "*.bmp" '.FilterIndex = 2 ' Set the filter index to 2 '.Filters.Add "All", "*.*" 'Set initial path .InitialFileName = "" 'Optionally show files as thumbnails '.InitialView = msoFileDialogViewThumbnail .InitialView = msoFileDialogViewList 'Show the dialog and test the return If .Show = 0 Then 'didn't pick a file - exit sub ChooseFile = "" Exit Function End If 'Should be only one file name - grab it ChooseFile = Trim(.SelectedItems(1)) 'On Error Resume Next 'Set error trap End With End Function