Jump to content

Yzöwl

Patron
  • Posts

    4,113
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    United Kingdom

Everything posted by Yzöwl

  1. I'll answer with another question. How do we deal with additional double quotes in runonceex.cmd?
  2. I've re-uploaded it, and fixed the posted code too with the correction for your remote desktop error! I hope it helps.
  3. Without seeing your actual file, we cannot be sure if the error is/is not with your DOS/OEM conversion. Here's a copy of what you've got in that file, produced on my system: @ECHO off Regedit /s tweaks.reg DEL "%AllUsersProfile%\Menu D‚marrer\Microsoft Update.lnk" DEL "%AllUsersProfile%\Bureau\VLC media player.lnk" DEL "%AllUsersProfile%\Bureau\Media Player Classic.lnk" DEL "%AllUsersProfile%\Bureau\Mozilla Thunderbird.lnk" DEL "%AllUsersProfile%\Bureau\Mozilla Firefox.lnk" DEL "%UserProfile%\Menu D‚marrer\Programmes\Assistance … distance.lnk" DEL "%UserProfile%\Menu D‚marrer\eBay.lnk" DEL "%SystemRoot%\system32\config\systemprofile\Menu D‚marrer\eBay.lnk" DEL "%UserProfile%\Bureau\CCleaner.lnk" DEL "%UserProfile%\Bureau\Foxit Reader.lnk" DEL "%UserProfile%\Bureau\ImgBurn.lnk" EXIT Due to potential problems with Browsers and software, I've attached it too! Try it and let us know how it goes. mooms.zip
  4. I've had another thought, first though how did you get on with my replacement code? After removing the directories, create zero byte files, possibly even with 'read only', 'hidden' or 'system' attributes and give them the names of those directories. What will happen then is that the system will be unable to re-create those directories due to the names already existing and will of course not be able to add files to them either!
  5. The reason you've got nothing happening from using my example is because you've got no files in the directory structure you're testing. DU does not list a file size if there are no files to list, (my mistake was to believe that you had some 0 byte files regardless). The fix for that scenario would be to replace Find with Findstr and look for both return outputs! @Echo off (Set D_=C:\Documents and Settings\MyDir) Du /q "%D_%"|Findstr "0\ bytes No\ matching">Nul 2>&1&&(Rd/s/q "%D_%")I hope this satisfies you a little better! Additional Note: Although difficult to tell from the written word, it does appear that your responses are a little over-aggressive. I have tried to give you help on more than one occasion recently and although I've done so without question, it does appear that you're less than thankful of the help you are receiving. I would appreciate it if that trend didn't continue
  6. The fastest and most suitable method I'd suggest for this task is to use a dedicated utility! I'll put forward Sysinternals DU (Disk Usage) @Echo off (Set D_=C:\Documents and Settings\MyDir) Du /q "%D_%"|Find "0 bytes">Nul 2>&1&&(Rd/s/q "%D_%")
  7. ...as clear as mud Please try again!
  8. You should ideally still be making some checks etc. in your script: Here's a commented batch file to show you the kind of thought processes I'd make as part of this task. The file still isn't fully error trapped nor tested , but it should give you something to work with! @Echo off Setlocal enableextensions :: Your UNC Path (Set S_=\\Server\Share) :: Your Intended Drive Letter (Set D_=Y:) :: String informing user impending mapping operation (Set M_=Mapping network drive ...) :: Check UNC Path validity If Not Exist "%S_%" ( Echo: Your UNC Path cannot be found Goto EndIt) :: Check to see if D_ is already mapped For /f "tokens 3*" %%# In ('2^>Nul Net use %D_%^|Find "\\"') Do (Set _=%%#) :: Unmapped - Map it and finish If Not Defined _ ( Call :Mapit Goto EndIt) :: Mapped - steps follow below :: Finish whilst already mapped to intended letter If /I "%_%" Equ "%S_%" ( Echo: %D_% is already mapped to %S_% Goto EndIt) :: Disconnect the required letters currently allocated share Echo: Required drive %D_% will be disconnected Net use %D_% /delete :: Map the intended share to required letter Call :MapIt :: Map the users original share to the next available letter and finish Echo: The mapped share %_% Echo: will now be re-mapped to the next available device :: Include additional switches as necessary Net use * "%_%" :EndIt Echo: Echo: Press any key to exit... Pause>Nul Goto :Eof :MapIt Echo: Echo: %M_% :: Include additional switches as necessary Net use %D_% "%S_%"
  9. It wouldn't cause damage, it would fail twice whereas your original attempt was a problem if it failed once! Your request was to check if a network drive was connected to Y: all I did was warn you that the script didn't do this!
  10. Just a small word of warning: The batch script example provided above doesn't differentiate between types of drive; drive E: may exist, but may not be assigned to another network drive.
  11. On behalf of all our membership please allow me to welcome you to the MSFN Forums. I hope you enjoy being part of something special!
  12. You can make this change using a simple inf file: [Version] Signature = "$Windows NT$" [DefaultInstall] BitReg = Bin.Set [Bin.Set] HKCU,Software\Microsoft\Windows\CurrentVersion\Explorer,ShellState,,0x04,4
  13. Whilst on the subject, just a quick reminder (plug)! addelay.cmd
  14. On behalf of all our membership please allow me to welcome you to the MSFN Forums. I hope you enjoy being part of something special!
  15. On behalf of all our membership please allow me to welcome you to the MSFN Forums. I hope you enjoy being part of something special!
  16. On behalf of all our membership please allow me to welcome you to the MSFN Forums. I hope you enjoy being part of something special!
  17. On behalf of all our membership please allow me to welcome you to the MSFN Forums. I hope you enjoy being part of something special!
  18. On behalf of all our membership please allow me to welcome you to the MSFN Forums. I hope you enjoy being part of something special!
  19. On behalf of all our membership please allow me to welcome you to the MSFN Forums. I hope you enjoy being part of something special!
  20. On behalf of all our membership please allow me to welcome you to the MSFN Forums. I hope you enjoy being part of something special!
  21. On behalf of all our membership please allow me to welcome you to the MSFN Forums. I hope you enjoy being part of something special!
  22. Yzöwl

    hi

    On behalf of all our membership please allow me to welcome you to the MSFN Forums. I hope you enjoy being part of something special!
  23. Yzöwl

    Hello

    On behalf of all our membership please allow me to welcome you to the MSFN Forums. I hope you enjoy being part of something special!
  24. On behalf of all our membership please allow me to welcome you to the MSFN Forums. I hope you enjoy being part of something special!
  25. On behalf of all our membership please allow me to welcome you to the MSFN Forums. I hope you enjoy being part of something special!
×
×
  • Create New...