Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Setting the window icon for a command prompt window

30 Jan 2015   #11
swiftie

Windows 7 Ultimate x64
 
 

Quote   Quote: Originally Posted by Pyprohly View Post
Swiftie, you are a genius
Thomas Edison said "Genius is one per cent inspiration, ninety-nine per cent perspiration."

I just happen to be good at the "perspiration" aspect. I can't let go of a problem. It's why I'm sitting at my PC at 05:45 in the morning, having woken up at 04:50 wondering about backups...


My System SpecsSystem Spec
.
30 Jan 2015   #12
swiftie

Windows 7 Ultimate x64
 
 

Thank you for helping me with my VBS script!

But, there's still work to be done.

My test shortcut was "C:\Users\Steve\Desktop\Split Test.lnk" and the line "objShell.Run strCommand,1" gave me a popup "The system cannot find the file specified".

Obviously, the classic "Filename containing a blank problem".
Renaming the shortcut to C:\Users\Steve\Desktop\Split_Test.lnk and modifying my "split_run.vbs" is a bypass, but now I find myself looking for a way to modify:

objShell.Run strCommand,1

... for the case where strCommand contains blanks.

This is just cosmetic nitpicking though, especially in the case where the underlying program ("split.rex" in my case) just needs to be run as a scheduled task. You can create the vbs "launcher" shortcut anywhere you like, so you won't have to look at an icon with a name of "Split_Test" (from the file "Split_Test.lnk").

If you really want to have an icon that you actually click, then you can create another shortcut, named whatever you like.
My System SpecsSystem Spec
30 Jan 2015   #13
Pyprohly

Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
 
 

Quote   Quote: Originally Posted by swiftie View Post
Obviously, the classic "Filename containing a blank problem".
Yeah. I tend to forget that paths can have spaces.

A small edit fixes the problem:

Code:
Dim strCommand, objShell
strCommand = """C:\Location\to\some script.rex.lnk"""
Set objShell = CreateObject("WScript.Shell")
objShell.Run strCommand,1


PS: How's the thread at Rexx Forums doing?
My System SpecsSystem Spec
.

Reply

 Setting the window icon for a command prompt window




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
Installation stuck with a command prompt window
Hi, I'm having an installation problem. I've previously done an installation of windows7 on my PC with no problems. However, I decided to reinstall windows when my PC was having some issues. I've chosen the 'upgrade' option when reinstalling windows. The problem came when I got a BSOD midway...
Installation & Setup
setting an environmental variable from command prompt
I live in the Linux world, so this might be a stupid question to Windows users. I need to set an environmental variable. I know I can do this through the control panel, but what a pain in the ass. If I open a command prompt and use the "set" command, the variable seems to last only as long as...
General Discussion
taskeng.exe opening in a Command Prompt window
Just now, I was reading posts here when a Command Prompt (black) windows opened, titled taskeng.exe. This is the Task Scheduler, right? Why is it opening a Command Prompt window, never did this before. I noticed The Windows update icon is now in the System area of the TaskBar, so I suspect it...
Windows Updates & Activation
Annoying prompt window
Hello. When I try to open up programs like Defraggler, Malwarebytes, Spybot or Revo Uninstaller that prompt on the pic bugs me. Even after I give all permissions from security tab it still comes. Is there a way to disable it except turning off user account control completely?
General Discussion
Window and Text size in Command Prompt, Windows XP Mode
Anybody know how to change the text size in Windows XP Mode at the command prompt? I've tried right clicking on the DOS shortcut that I set up and changing it there, but it doesn't do anything. Also, I've set it to Full Screen, but everytime I execute a program, it shrinks to a smaller window....
Virtualization
Command Prompt From Explorer Window
How do I open a command prompt from an Explorer Window? Of course it must open at the same path without having to type in navigation commands (that's the whole point). Thanks, Jon
General Discussion


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 14:27.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App